Blame | Last modification | View Log | RSS feed
#!/bin/sh# Check whether 0anacron was run today alreadyif test -r /var/spool/anacron/cron.daily; thenday=`cat /var/spool/anacron/cron.daily`fiif [ `date +%Y%m%d` = "$day" ]; thenexit 0fi# Do not run jobs when on battery poweronline=1for psupply in AC ADP0 ; dosysfile="/sys/class/power_supply/$psupply/online"if [ -f $sysfile ] ; thenif [ `cat $sysfile 2>/dev/null`x = 1x ]; thenonline=1breakelseonline=0fifidoneif [ $online = 0 ]; thenexit 0fi/usr/sbin/anacron -s