X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=filesystem%2Fusr%2Flocal%2Fbin%2Fmyupgrade;h=7be700124f79cf8c50c741803d4d0ce0571ad315;hb=77c0b307b372824b45e8d3f78f3add554e7229ab;hp=e5401dc836675ab54f9aafb31490ca5cf08ed7e7;hpb=12cab163424e3a7b0815646d1d4407f9b5839bcb;p=distro-setup diff --git a/filesystem/usr/local/bin/myupgrade b/filesystem/usr/local/bin/myupgrade index e5401dc..7be7001 100755 --- a/filesystem/usr/local/bin/myupgrade +++ b/filesystem/usr/local/bin/myupgrade @@ -38,16 +38,13 @@ myreboot() { } -if [[ $HOSTNAME != "$MAIL_HOST" ]]; then - ksta=$(needrestart -b | sed -n 's/NEEDRESTART-KSTA: *//p'); - case $ksta in - 1) : ;; - [023]) myreboot ;; - *) err error: unknown kernel status ;; - esac -fi +# TODO: executed from cron, this doesnt sent an email when we reboot, +# because rebooting from the script stops the ability to send email. +# We should figure some workaround. -# needsrestarts automatic restarts failed. if ! out=$(/sbin/needrestart -p 2>&1); then e "$out" + if [[ $HOSTNAME != "$MAIL_HOST" ]]; then + myreboot + fi fi