Reboot prompt for updates

Experimenting with swanag stuff. Check if reboot is required, nag to reboot, include installed packages in details.
This commit is contained in:
John Mertz 2022-07-20 23:11:59 -04:00
parent dcbb22bf8a
commit 8c1eddbf83
Signed by: jpm
GPG Key ID: E9C5EA2D867501AB
1 changed files with 3 additions and 0 deletions

View File

@ -23,6 +23,9 @@ elif [ "$1" == 'upgrade' ]; then
COUNT=`apt list --upgradable 2> /dev/null | wc -l` COUNT=`apt list --upgradable 2> /dev/null | wc -l`
let COUNT-- let COUNT--
echo $COUNT > /home/jpm/.spool/apt-upgradeable echo $COUNT > /home/jpm/.spool/apt-upgradeable
if [ -e /var/run/reboot-required ]; then
cat /var/log/apt/history.log | tr "\n" "%" | sed -e 's/.*\(Start-Date\)/\1/g' | tr "%" "\n" | swaynag --config=${HOME}/.dotfiles/sway/swaynag --edge=bottom --message="New packages require restart" --button="Restart Now" "sudo systemctl reboot" --dismiss-button="Later" --detailed-message --detailed-button "Show/Hide Upgrade Details"
fi
elif [ "$1" == 'update' ]; then elif [ "$1" == 'update' ]; then
sudo apt update >/dev/null 2>/dev/null sudo apt update >/dev/null 2>/dev/null
COUNT=`apt list --upgradable 2> /dev/null | wc -l` COUNT=`apt list --upgradable 2> /dev/null | wc -l`