Include /lib/lsb/init-functions in the init script
[fake-hwclock.git] / debian / fake-hwclock.init
1 #!/bin/sh
2
3 ### BEGIN INIT INFO
4 # Provides:          fake-hwclock
5 # Required-Start:
6 # Required-Stop:     umountroot
7 # Should-Stop:       
8 # X-Start-Before:    checkroot
9 # Default-Start:     S
10 # Default-Stop:      0 1 6
11 # Short-Description: Restore / save the current clock
12 # Description:       
13 ### END INIT INFO
14
15 set -e
16
17 # Include core init functions if needed
18 . /lib/lsb/init-functions
19
20 PARAM=/etc/default/fake-hwclock
21 if [ -f $PARAM ]; then
22     . "$PARAM"
23 fi
24
25 case "${1:-}" in
26   stop|reload|restart|force-reload)
27         echo "Stopping fake hwclock: saving system time."
28         fake-hwclock save;;
29
30   start)
31         echo "Starting fake hwclock: loading system time."
32         fake-hwclock load $FORCE ;;
33
34   *)
35         echo "Usage: ${0:-} {start|stop|status|restart|reload|force-reload}" >&2
36         exit 1
37         ;;
38 esac