Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VsJfJngYUpB4dr77GvcEb8
15 lines
478 B
Bash
Executable File
15 lines
478 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SERVICE=brewpi
|
|
DEPLOY_DIR="$(dirname "$(realpath "$0")")"
|
|
UNIT_FILE="${DEPLOY_DIR}/${SERVICE}.service"
|
|
TARGET=/etc/systemd/system/${SERVICE}.service
|
|
|
|
export BREWPI_HOME="$(realpath "${DEPLOY_DIR}/..")"
|
|
envsubst < "$UNIT_FILE" | sudo tee "$TARGET" > /dev/null
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable "$SERVICE"
|
|
echo "Installed. Start with: sudo systemctl start $SERVICE"
|
|
echo "View logs with: journalctl -u $SERVICE -f"
|