Last active
January 31, 2018 12:54
-
-
Save xorenio/404d77cb332f785f3029d9e1d6b2ecec to your computer and use it in GitHub Desktop.
Debian or Ubuntu update or reboot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
UPDATES=$(LANG=C apt-get upgrade -s |grep -P '^\d+ upgraded'|cut -d" " -f1); | |
if [ $UPDATES -lt 0 ]; then | |
reboot | |
else | |
echo "yay you finally updated"; | |
fi | |
exit 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment