nextcloud-entrypoint: don't wait forever for onlyoffice to become available

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L. 2025-11-18 12:13:50 +01:00
parent 7560694535
commit c0dfba5272

View file

@ -769,12 +769,16 @@ if [ "$ONLYOFFICE_ENABLED" = 'yes' ]; then
ONLYOFFICE_PORT=443
fi
# Wait for OnlyOffice to become available
while ! nc -z "$ONLYOFFICE_HOST" "$ONLYOFFICE_PORT"; do
count=0
while ! nc -z "$ONLYOFFICE_HOST" "$ONLYOFFICE_PORT" && [ "$count" -lt 90 ]; do
echo "Waiting for OnlyOffice to become available..."
count=$((count+5))
sleep 5
done
if [ "$count" -ge 90 ]; then
bash /notify.sh "Onlyoffice did not start in time!" "Skipping initialization and disabling onlyoffice app."
php /var/www/html/occ app:disable onlyoffice
else
# Install or enable OnlyOffice app as needed
if ! [ -d "/var/www/html/custom_apps/onlyoffice" ]; then
php /var/www/html/occ app:install onlyoffice
@ -796,6 +800,7 @@ if [ "$ONLYOFFICE_ENABLED" = 'yes' ]; then
fi
php /var/www/html/occ config:app:set onlyoffice DocumentServerUrl --value="https://$ONLYOFFICE_HOST"
fi
else
# Remove OnlyOffice app if disabled and removal is requested
if [ "$REMOVE_DISABLED_APPS" = yes ] && \
@ -867,7 +872,7 @@ if [ "$CLAMAV_ENABLED" = 'yes' ]; then
sleep 5
done
if [ "$count" -ge 90 ]; then
echo "ClamAV did not start in time. Skipping initialization and disabling files_antivirus app."
bash /notify.sh "ClamAV did not start in time!" "Skipping initialization and disabling files_antivirus app."
php /var/www/html/occ app:disable files_antivirus
else
if ! [ -d "/var/www/html/custom_apps/files_antivirus" ]; then