#!/bin/sh
#
# anacron's cron script
#
# This script updates anacron time stamps. It is called through run-parts
# either by anacron itself or by cron.
#
# The script is called "0anacron" to assure that it will be executed
# _before_ all other scripts.

# on_ac_power doesn't exist, on_ac_power returns 0 (ac power being used)
if test -x /usr/bin/on_ac_power
       then
       /usr/bin/on_ac_power &> /dev/null
        if test $? -eq 1
           then
               echo "deferred while on battery power."
           exit 0
        fi
fi

test -x /usr/sbin/anacron || exit 0
anacron -u cron.monthly
