Skip to content

Commit

Permalink
Source directly from /etc/default/anacron
Browse files Browse the repository at this point in the history
  • Loading branch information
fgozzini authored and t8m committed Jan 9, 2023
1 parent cc2903f commit b53221f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions contrib/0anacron
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@ if [ `date +%Y%m%d` = "$day" ]; then
fi

# Check whether run on battery should be allowed
check_online=1
if test -r /etc/default/anacron; then
run_on_battery=`grep ANACRON_RUN_ON_BATTERY_POWER /etc/default/anacron | awk -F'=' '{print $2}'`
if [ $run_on_battery = "yes" ]; then
check_online=0
fi
fi
. /etc/default/anacron

if [ $check_online = 1 ]; then
if [ $ANACRON_RUN_ON_BATTERY_POWER != "yes" ]; then

# Do not run jobs when on battery power
online=1
Expand Down

0 comments on commit b53221f

Please sign in to comment.