Fix deploy.sh: don't prompt for systemd service if already installed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul Trowbridge 2026-04-05 16:13:06 -04:00
parent 0994d48383
commit 1b34dc830b

View File

@ -362,10 +362,12 @@ fi
SERVICE_FILE="/etc/systemd/system/dataflow.service" SERVICE_FILE="/etc/systemd/system/dataflow.service"
if confirm "Systemd Service"; then section "Systemd Service"
if [ -f "$SERVICE_FILE" ]; then if [ -f "$SERVICE_FILE" ]; then
info "already installed" info "already installed"
else else
read -p " Not installed. Install now? (requires sudo) [y/N]: " _yn
if [[ "$_yn" =~ ^[Yy]$ ]]; then
step "Installing service" step "Installing service"
sudo cp "$SCRIPT_DIR/dataflow.service" "$SERVICE_FILE" && ok \ sudo cp "$SCRIPT_DIR/dataflow.service" "$SERVICE_FILE" && ok \
|| fail "Could not install service" || fail "Could not install service"
@ -373,9 +375,9 @@ if confirm "Systemd Service"; then
step "Enabling on boot" step "Enabling on boot"
sudo systemctl daemon-reload && sudo systemctl enable dataflow > /dev/null 2>&1 && ok \ sudo systemctl daemon-reload && sudo systemctl enable dataflow > /dev/null 2>&1 && ok \
|| fail "Could not enable service" || fail "Could not enable service"
else
info "skipped"
fi fi
else
info "skipped"
fi fi
# ── API Server ──────────────────────────────────────────────────────────────── # ── API Server ────────────────────────────────────────────────────────────────