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