bundles/apt: check for "reboot required" in icinga check only
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit
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:
parent
11969b6064
commit
4cfbdb32d6
2 changed files with 12 additions and 13 deletions
|
@ -22,12 +22,16 @@ case "$exitcode" in
|
|||
exit 1
|
||||
;;
|
||||
reboot)
|
||||
echo "Upgrades require a reboot, but automatic rebooting is disabled"
|
||||
exit 1
|
||||
;;
|
||||
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"
|
||||
|
|
|
@ -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" ]]
|
||||
then
|
||||
echo "reboot" > "$statusfile"
|
||||
else
|
||||
if [[ -n "$reboot_mail_to" ]]
|
||||
then
|
||||
date | mail -s "SYSREBOOTNOW $nodename" "$reboot_mail_to"
|
||||
fi
|
||||
systemctl reboot
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "upgrade-and-reboot for node $nodename is DONE"
|
||||
|
|
Loading…
Reference in a new issue