Skip to content

Instantly share code, notes, and snippets.

@c1b3rh4ck
Created January 24, 2015 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save c1b3rh4ck/454c1cb95800c2b224ce to your computer and use it in GitHub Desktop.
Save c1b3rh4ck/454c1cb95800c2b224ce to your computer and use it in GitHub Desktop.
Simulate system up to date debian
#!/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