Nextcloud-AIO_OnlyOffice_Av.../usr/local/sbin/onlyoffice-auto-fix.sh
2025-11-23 12:39:43 +01:00

30 lines
609 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
LOCK="/tmp/onlyoffice-check.lock"
LOG="/var/log/onlyoffice-auto-fix.log"
if [ -f "$LOCK" ]; then
echo "$(date '+%F %T') : lock present, skipping" >> "$LOG"
exit 0
fi
touch "$LOCK"
{
echo " "
echo "===== $(date '+%F %T') : Running OnlyOffice check ====="
docker exec nextcloud-aio-nextcloud \
sudo -E -u www-data php occ onlyoffice:documentserver --check
STATUS=$?
if [ $STATUS -eq 0 ]; then
echo "$(date '+%F %T') : OK ✓"
else
echo "$(date '+%F %T') : ERROR DocumentServer not ready ❌"
fi
} >> "$LOG" 2>&1
rm -f "$LOCK"