File size: 932 Bytes
6ac6f3c
af5c576
6ac6f3c
 
af5c576
 
 
 
 
 
 
 
 
dd57988
 
af5c576
 
 
 
 
 
6ac6f3c
 
af5c576
6ac6f3c
 
 
af5c576
 
 
210a231
af5c576
 
210a231
af5c576
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/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