3 # cron job for apt-get update
5 # Update-Package-Intervall is in days
7 STAMP
=/var
/lib
/apt
/update
-stamp
14 if apt
-get update
-qq; then
15 if [ -x /usr
/bin
/dbus
-send ]; then
16 dbus
-send --system / app.apt.dbus.updated boolean
:true
24 RES
=`apt-config shell UpdateInterval APT::Periodic::Update-Package-Lists`
27 if [ $UpdateInterval -eq 0 ]; then
31 # laptop check, on_ac_power returns:
32 # 0 (true) System is on mains power
33 # 1 (false) System is not on mains power
34 # 255 (false) Power status could not be determined
35 # Desktop systems always return 255 it seems
36 if [ -x /usr
/bin
/on_ac_power
]; then
43 if [ ! -f $STAMP ]; then
48 LastUpdate
=`stat -c "%Y" $STAMP 2>/dev/null`
51 NeedUpdate
=$(($LastUpdate+$UpdateInterval*3600*24))
52 if [ $NeedUpdate -le $Now ]; then