~ubuntu-branches/ubuntu/raring/mlocate/raring

« back to all changes in this revision

Viewing changes to debian/mlocate.cron.daily

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-06-26 15:19:06 UTC
  • Revision ID: james.westby@ubuntu.com-20080626151906-zksyv8ubdbj6qiz4
Tags: 0.20-2ubuntu1
Skip cron job if on battery power.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
[ -x /usr/bin/updatedb.mlocate ] || exit 0
6
6
 
 
7
if which on_ac_power >/dev/null 2>&1; then
 
8
    AC_POWER=0
 
9
    on_ac_power >/dev/null 2>&1 || AC_POWER=$?
 
10
    if [ "$AC_POWER" -eq 1 ]; then
 
11
        echo >&2 "On battery power, not running today."
 
12
        exit 1
 
13
    fi
 
14
fi
 
15
 
7
16
##
8
17
 
9
18
LOCKFILE="/var/lib/mlocate/daily.lock"