From: Ian Kelling Date: Wed, 16 Feb 2022 05:01:18 +0000 (-0500) Subject: automatically reboot on services needsrestart doesnt handle X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=c7219eb0f2415e8a95c6d7bd98503c61098f9049 automatically reboot on services needsrestart doesnt handle --- diff --git a/filesystem/usr/local/bin/myupgrade b/filesystem/usr/local/bin/myupgrade index e5401dc..ee1890f 100755 --- a/filesystem/usr/local/bin/myupgrade +++ b/filesystem/usr/local/bin/myupgrade @@ -38,16 +38,9 @@ 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 - -# needsrestarts automatic restarts failed. if ! out=$(/sbin/needrestart -p 2>&1); then e "$out" + if [[ $HOSTNAME != "$MAIL_HOST" ]]; then + myreboot + fi fi