Files
study-bible-project/restart.sh
T
nmemmertandClaude Sonnet 4.6 00932dee4a
Build and Push Docker Image / build-and-push (push) Successful in 2m36s
Update restart.sh to reference Gitea instead of GitHub
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-02 09:39:49 -04:00

30 lines
680 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
stop_pid_file() {
local pid_file="$1"
local label="$2"
if [ -f "$pid_file" ]; then
local old_pid
old_pid=$(cat "$pid_file")
if kill -0 "$old_pid" 2>/dev/null; then
echo "Stopping $label (PID $old_pid)..."
kill "$old_pid"
sleep 1
fi
rm -f "$pid_file"
fi
}
stop_pid_file "$ROOT_DIR/.api.pid" "API server"
stop_pid_file "$ROOT_DIR/.vite.pid" "Vite server"
echo "Pulling latest changes from Gitea..."
cd "$ROOT_DIR"
git checkout -- package-lock.json 2>/dev/null || true
git pull
echo "Restarting via setup.sh..."
exec "$ROOT_DIR/setup.sh"