Created
January 24, 2015 20:50
-
-
Save c1b3rh4ck/454c1cb95800c2b224ce to your computer and use it in GitHub Desktop.
Simulate system up to date debian
This file contains hidden or 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 | |
#Cron Script Run from /etc/crontab.daily | |
#runs apt-get update and prints the output of a simulated | |
#dist-upgrade if new packages are found, also you can add a line in crontab with a pipe | |
#to run a mail. | |
if [[`apt-get update 2>&1|grep Get` ]]; then | |
if [[`apt-get --simulate dist-upgrade 2>&1|grep Inst` ]];then | |
apt-get --simulate dist-upgrade | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment