Initial commit
This commit is contained in:
18
deploy/scripts/install_service.sh
Executable file
18
deploy/scripts/install_service.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT="${1:-/home/bestmidi/chgrid}"
|
||||
UNIT_NAME="${2:-chgrid-signaling.service}"
|
||||
SRC_UNIT="$REPO_ROOT/deploy/systemd/$UNIT_NAME"
|
||||
DST_UNIT="/etc/systemd/system/$UNIT_NAME"
|
||||
|
||||
if [[ ! -f "$SRC_UNIT" ]]; then
|
||||
echo "error: unit file not found: $SRC_UNIT" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo cp "$SRC_UNIT" "$DST_UNIT"
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now "$UNIT_NAME"
|
||||
sudo systemctl restart "$UNIT_NAME"
|
||||
sudo systemctl status "$UNIT_NAME" --no-pager
|
||||
Reference in New Issue
Block a user