deploy: apply helper reboots only when the rollback itself failed

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KqhjP7nud5gdBg25zCiRk9
This commit is contained in:
2026-09-23 18:46:16 -04:00
co-authored by Claude Sonnet 5
parent d46fd5a1e4
commit ca7d22384b
2 changed files with 15 additions and 4 deletions
+4 -1
View File
@@ -345,10 +345,13 @@ restore() { # restore <reason>: put the pre-run netplan back, re-check connecti
if [ "\$rb" = ok ] && [ "\$c" = ok ]; then
echo "apply-network ROLLED BACK (restored, connectivity ok)"
status rolled-back "\$1"
elif [ "\$rb" = ok ]; then
echo "apply-network ROLLED BACK (restored, but no connectivity - check the uplink/cable)"
status rolled-back restored-no-connectivity
else
echo "apply-network ROLLBACK FAILED: \$rb / connectivity \$c"
status rollback-failed "\$1; \$rb / connectivity \$c"
[ "\$c" = ok ] || { echo "no connectivity after rollback - rebooting"; systemctl reboot; }
[ "\$c" = ok ] || { echo "rollback failed and no connectivity - rebooting (boot uses the files on disk)"; systemctl reboot; }
fi
exit 1
}