bundles/apt: add flag to disable automatic rebooting
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 commit is contained in:
parent
4c59479d5c
commit
fb931df4f0
3 changed files with 15 additions and 5 deletions
|
@ -21,6 +21,10 @@ case "$exitcode" in
|
|||
echo "Upgrades skipped due to active SSH login"
|
||||
exit 1
|
||||
;;
|
||||
reboot)
|
||||
echo "Upgrades require a reboot, but automatic rebooting is disabled"
|
||||
exit 1
|
||||
;;
|
||||
0)
|
||||
echo "OK"
|
||||
exit 0
|
||||
|
|
|
@ -46,11 +46,16 @@ fi
|
|||
|
||||
if [[ -f /var/run/reboot-required ]]
|
||||
then
|
||||
if [[ -n "$reboot_mail_to" ]]
|
||||
if [[ "$auto_reboot_enabled" == "False" ]]
|
||||
then
|
||||
date | mail -s "SYSREBOOTNOW $nodename" "$reboot_mail_to"
|
||||
echo "reboot" > "$statusfile"
|
||||
else
|
||||
if [[ -n "$reboot_mail_to" ]]
|
||||
then
|
||||
date | mail -s "SYSREBOOTNOW $nodename" "$reboot_mail_to"
|
||||
fi
|
||||
systemctl reboot
|
||||
fi
|
||||
systemctl reboot
|
||||
else
|
||||
echo "upgrade-and-reboot for node $nodename is DONE"
|
||||
fi
|
||||
|
||||
echo "upgrade-and-reboot for node $nodename is DONE"
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
nodename="${node.name}"
|
||||
reboot_mail_to="${node.metadata.get('apt/unattended-upgrades/reboot_mail_to', '')}"
|
||||
auto_reboot_enabled="${node.metadata.get('apt/unattended-upgrades/reboot-enabled', True)}"
|
||||
|
|
Loading…
Reference in a new issue