X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=filesystem%2Fusr%2Flocal%2Fbin%2Fmyupgrade;h=55e722135bd203055b81a21cd15652f5e2d79523;hb=63acc2d602eb316a1c0abb7ec842e4789c8beaec;hp=3df5f0e12211b67707eb8616ed27bbd687254c65;hpb=343a048be4b32d18540c6531048d2b9a006774ae;p=distro-setup diff --git a/filesystem/usr/local/bin/myupgrade b/filesystem/usr/local/bin/myupgrade index 3df5f0e..55e7221 100755 --- a/filesystem/usr/local/bin/myupgrade +++ b/filesystem/usr/local/bin/myupgrade @@ -13,7 +13,12 @@ if [[ $HOSTNAME == "$MAIL_HOST" || $hn == li.b8.nz ]]; then exit 0 fi -if [[ $(/usr/sbin/checkrestart | wc -l) != 1 ]]; then +cmd="$s /usr/sbin/checkrestart -p" +if [[ $($cmd | sed '/^Found 0 processes using old versions of upgraded files$/d' | wc -l) != 0 ]]; then + $cmd -v | pee cat "wall -n" +fi + +if [[ -s /var/log/checkrestart.log ]]; then for x in {30..1}; do echo "pid $PID. unattended upgrade, rebooting in $((x*10)) seconds" | wall -n sleep 10