elmerzole commited on
Commit
af5c576
·
verified ·
1 Parent(s): 2b1431d

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +23 -7
entrypoint.sh CHANGED
@@ -1,17 +1,33 @@
1
  #!/usr/bin/env bash
2
- set -e
3
 
4
  echo "[entrypoint] Restoring DB (if backup exists)..."
5
- /home/user/entrypoint/restore.sh || echo "No restore available"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  echo "[entrypoint] Starting Gotify..."
8
- gotify &
9
  GOTIFY_PID=$!
10
 
11
  # Background backup loop
12
- ( while true; do
13
- /home/user/entrypoint/backup.sh || echo "Backup failed"
 
14
  sleep ${BACKUP_INTERVAL:-300}
15
- done ) &
 
16
 
17
- wait $GOTIFY_PID
 
1
  #!/usr/bin/env bash
2
+ set -euo pipefail
3
 
4
  echo "[entrypoint] Restoring DB (if backup exists)..."
5
+ /home/user/entrypoint/restore.sh || echo "[entrypoint] No restore available"
6
+
7
+ echo "[entrypoint] Locating Gotify binary..."
8
+ if command -v gotify >/dev/null 2>&1; then
9
+ GOTIFY_CMD="$(command -v gotify)"
10
+ elif [ -x /app/gotify ]; then
11
+ GOTIFY_CMD="/app/gotify"
12
+ elif [ -x /usr/local/bin/gotify ]; then
13
+ GOTIFY_CMD="/usr/local/bin/gotify"
14
+ else
15
+ echo "[entrypoint] ERROR: gotify binary not found!"
16
+ find / -maxdepth 3 -type f -name 'gotify*' 2>/dev/null || true
17
+ exit 1
18
+ fi
19
+ echo "[entrypoint] Using Gotify binary: $GOTIFY_CMD"
20
 
21
  echo "[entrypoint] Starting Gotify..."
22
+ "$GOTIFY_CMD" &
23
  GOTIFY_PID=$!
24
 
25
  # Background backup loop
26
+ (
27
+ while true; do
28
+ /home/user/entrypoint/backup.sh || echo "[backup] Backup failed"
29
  sleep ${BACKUP_INTERVAL:-300}
30
+ done
31
+ ) &
32
 
33
+ wait $GOTIFY_PID