I am running a system with only SSH access, and I miss a reboot notifier in the CLI after a major system update.
I know how to play it by ear and reboot when I think it’s a good idea, but it still would be nice to get a notification in the CLI which mirrors what the GUI reboot notifier does. I searched a little, but wasn’t able to find a solution. Any ideas?
#!/usr/bin/bash
# Do we need a reboot in arch?
s1=$(pacman -Q linux | sed 's/linux //')
s2=$(uname -r | sed 's/-a/\.a/')
[[ "$s1" = "$s2" ]] && echo "OK" || echo "REBOOT"