BlueGit

timfa filemanager

Files

filemanager / start.sh

start.sh

fixes and updates
timfa Tim Falken · pushed by timfa · 6 months ago
0ae63c84 History
start.sh 600 B Download Raw
1#!/usr/bin/env bash
2# start.sh — used as the systemd service ExecStart.
3# Pulls latest code, installs dependencies, then replaces this shell with
4# the Node process so systemd tracks the correct PID and restart works.
5
6set -euo pipefail
7
8SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9cd "$SCRIPT_DIR"
10
11echo "Clearing old database lock if needed"
12rm filemanager.db.lock
13
14echo "[start.sh] git reset --hard"
15git reset --hard
16
17echo "[start.sh] git pull"
18git pull
19
20echo "[start.sh] npm install --omit=dev"
21npm install --omit=dev
22
23echo "[start.sh] starting server"
24exec node server/index.js