gotify / entrypoint.sh
elmerzole's picture
Update entrypoint.sh
dd57988 verified
#!/usr/bin/env bash
set -euo pipefail
echo "[entrypoint] Restoring DB (if backup exists)..."
/home/user/entrypoint/restore.sh || echo "[entrypoint] No restore available"
echo "[entrypoint] Locating Gotify binary..."
if command -v gotify >/dev/null 2>&1; then
GOTIFY_CMD="$(command -v gotify)"
elif [ -x /app/gotify ]; then
GOTIFY_CMD="/app/gotify"
elif [ -x /usr/local/bin/gotify ]; then
GOTIFY_CMD="/usr/local/bin/gotify"
elif [ -x /app/gotify-app ]; then
GOTIFY_CMD="/app/gotify-app"
else
echo "[entrypoint] ERROR: gotify binary not found!"
find / -maxdepth 3 -type f -name 'gotify*' 2>/dev/null || true
exit 1
fi
echo "[entrypoint] Using Gotify binary: $GOTIFY_CMD"
echo "[entrypoint] Starting Gotify..."
"$GOTIFY_CMD" &
GOTIFY_PID=$!
# Background backup loop
(
while true; do
/home/user/entrypoint/backup.sh || echo "[backup] Backup failed"
sleep ${BACKUP_INTERVAL:-300}
done
) &
wait $GOTIFY_PID