bundles/apt: check for "reboot required" in icinga check only
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit

This avoids the need to manually adjust the status file after a reboot of
the server.
This commit is contained in:
Franzi 2022-01-30 11:43:14 +01:00
parent 11969b6064
commit 4cfbdb32d6
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 12 additions and 13 deletions

View file

@ -22,12 +22,16 @@ case "$exitcode" in
exit 1
;;
reboot)
echo "Upgrades require a reboot, but automatic rebooting is disabled"
exit 1
;;
0)
echo "OK"
exit 0
if [[ -f /var/run/reboot-required ]]
then
echo "OK, but updates require a reboot"
exit 1
else
echo "OK"
exit 0
fi
;;
*)
echo "Last exitcode was $exitcode"

View file

@ -44,18 +44,13 @@ then
exit 1
fi
if [[ -f /var/run/reboot-required ]]
if [[ -f /var/run/reboot-required ]] && [[ "$auto_reboot_enabled" == "True" ]]
then
if [[ "$auto_reboot_enabled" == "False" ]]
if [[ -n "$reboot_mail_to" ]]
then
echo "reboot" > "$statusfile"
else
if [[ -n "$reboot_mail_to" ]]
then
date | mail -s "SYSREBOOTNOW $nodename" "$reboot_mail_to"
fi
systemctl reboot
date | mail -s "SYSREBOOTNOW $nodename" "$reboot_mail_to"
fi
systemctl reboot
fi
echo "upgrade-and-reboot for node $nodename is DONE"