Created
February 27, 2012 20:44
-
-
Save codatory/1926909 to your computer and use it in GitHub Desktop.
Debian / Ubuntu Check update script
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 | |
apt-get update -qq | |
UPDATES=`apt-get dist-upgrade --simulate | grep Inst | awk '{print $2}'` | |
COUNT=`printf "%s\n" "$UPDATES" | grep -v "^$" | wc -l` | |
echo '--------------------------------------------------------------------------------' | |
echo " Weekly Update Notification for `hostname`" | |
echo " -> $COUNT update(s) available" | |
echo '--------------------------------------------------------------------------------' | |
printf "%s\n" "$UPDATES" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment