@@ -123,7 +123,7 @@ case "${1:-}" in
123123
124124 status)
125125 shift
126- if has_systemd && systemctl is-enabled baudbot & > /dev/null 2>&1 ; then
126+ if has_systemd && systemctl is-enabled baudbot & > /dev/null; then
127127 exec systemctl status baudbot " $@ "
128128 else
129129 # Fallback: check if baudbot_agent has pi running
@@ -138,7 +138,7 @@ case "${1:-}" in
138138
139139 logs)
140140 shift
141- if has_systemd && systemctl is-enabled baudbot & > /dev/null 2>&1 ; then
141+ if has_systemd && systemctl is-enabled baudbot & > /dev/null; then
142142 exec journalctl -u baudbot -f " $@ "
143143 else
144144 echo " No systemd unit. Check tmux sessions:"
@@ -254,14 +254,28 @@ case "${1:-}" in
254254
255255 update)
256256 shift
257- # For now: git pull + deploy
258257 require_root " update"
259258 echo " === Pulling latest ==="
260259 cd " $BAUDBOT_ROOT "
261260 git pull origin main
262261 echo " "
263262 echo " === Deploying ==="
264- exec " $BAUDBOT_ROOT /bin/deploy.sh" " $@ "
263+ " $BAUDBOT_ROOT /bin/deploy.sh" " $@ "
264+ echo " "
265+ # Restart if currently running
266+ if has_systemd && systemctl is-active baudbot & > /dev/null; then
267+ echo " === Restarting ==="
268+ systemctl restart baudbot
269+ # Wait for ExecStartPre hooks + process init
270+ sleep 3
271+ if systemctl is-active baudbot & > /dev/null; then
272+ echo " ✅ Updated and running"
273+ else
274+ echo " ⚠️ Deployed but agent didn't restart — check: baudbot logs"
275+ fi
276+ else
277+ echo " ✅ Updated. Start with: sudo baudbot start"
278+ fi
265279 ;;
266280
267281 uninstall)
0 commit comments