BlueGit

timfa filemanager

Files

filemanager / start.sh

start.sh

dl video fix
timfa Tim Falken · pushed by timfa · 5 months ago
a0162cfc History
start.sh 604 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 -rf 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