Import Debian version 0.8
[apt-update.git] / debian / tmp / etc / cron.daily / apt-update
1 #!/bin/sh
2 #
3 # apt-update cron job
4 #
5 # Simple wrapper script for cron to use - check for updated packages
6 # and mail admin with any recommended upgrades.
7
8 # Assumes that apt is configured correctly before we start...
9 #
10 # Steve McIntyre 26/09/2001
11
12 . /etc/apt/update.conf
13
14 if [ "$MAILTO"x = ""x ] ; then
15     MAILTO=postmaster
16 fi
17
18 UPDATE_LIST=`apt-update`
19 HOST=`uname -n`
20
21 if [ "$UPDATE_LIST"x != ""x ] ; then
22     # Now send mail to the local admin
23     UPDATE_LIST="On $HOST the following packages need upgrading:\n$UPDATE_LIST"
24     echo -e "$UPDATE_LIST" | mail -s "$HOST needs software updates" $MAILTO
25 fi