Detect if the clock seems to be going backwards
[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 PARAM=/etc/default/fake-hwclock
18 if [ -f $PARAM ]; then
19     . "$PARAM"
20 fi
21
22 case "${1:-}" in
23   stop|reload|restart|force-reload)
24         echo "Stopping fake hwclock: saving system time."
25         fake-hwclock save;;
26
27   start)
28         echo "Starting fake hwclock: loading system time."
29         fake-hwclock load $FORCE ;;
30
31   *)
32         echo "Usage: ${0:-} {start|stop|status|restart|reload|force-reload}" >&2
33         exit 1
34         ;;
35 esac