Skip to content

Instantly share code, notes, and snippets.

@mgcon
Created August 17, 2015 02:13
Show Gist options
  • Save mgcon/be3ac2575ca75ed16760 to your computer and use it in GitHub Desktop.
Save mgcon/be3ac2575ca75ed16760 to your computer and use it in GitHub Desktop.
check apt for available updates
# /bin/bash
#this file just checks to see if there are any packages to install
# we will run this script from the root crontab each night
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