File: init.d

package info (click to toggle)
anacron 2.3-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 228 kB
  • ctags: 157
  • sloc: ansic: 1,159; makefile: 99; sh: 61
file content (32 lines) | stat: -rw-r--r-- 703 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/sh
# /etc/init.d/anacron: start anacron
#

PATH=/bin:/usr/bin:/sbin:/usr/sbin

test -f /usr/sbin/anacron || exit 0

case "$1" in
  start)
    # Really on_ac_power is not a sufficient test, as it only looks at
    # APM and we ought to also check whether we're on a UPS battery.
    if test \! -x /usr/bin/on_ac_power || on_ac_power >/dev/null
    then
        echo -n "Starting anac(h)ronistic cron: anacron"
        anacron -s
        echo "."
    else       
        echo "Starting anac(h)ronistic cron: deferred while on battery power."
    fi
    ;;
  restart|force-reload|stop)
  	# nothing to do
    :
    ;;
  *)
    echo "Usage: /etc/init.d/anacron start"
    exit 1
    ;;
esac

exit 0