Skip to content

Commit 4569b34

Browse files
fix(startup): use correct logic
1 parent 20a9f83 commit 4569b34

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

scripts/run.sh

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
#!/bin/bash
22
set -e
33

4-
# Restore the database if it does not already exist.
5-
if [[ -f "${DB_PATH}" || "${UPTIME_KUMA_DB_TYPE}" != 'mariadb' ]]; then
6-
echo "Database already exists, skipping restore"
7-
else
8-
echo "No database found, restoring from replica if exists"
9-
litestream restore -if-replica-exists -o "${DB_PATH}" "${REPLICA_URL}"
10-
fi
11-
124
if [[ "${UPTIME_KUMA_DB_TYPE}" != 'mariadb' ]]; then
135
exec node server/server.js
146
else
7+
# Restore the database if it does not already exist.
8+
if [[ -f "${DB_PATH}" ]]; then
9+
echo "Database already exists, skipping restore"
10+
else
11+
echo "No database found, restoring from replica if exists"
12+
litestream restore -if-replica-exists -o "${DB_PATH}" "${REPLICA_URL}"
13+
fi
1514
# Run litestream with your app as the subprocess.
1615
exec litestream replicate -exec "node server/server.js"
1716
fi

0 commit comments

Comments
 (0)