Enabled force setting system time on boot.
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / ntp
1 #!/bin/sh
2 # Begin $rc_base/init.d/ntp
3
4 . /etc/sysconfig/rc
5 . $rc_functions
6
7 eval $(/usr/local/bin/readhash /var/ipfire/time/settings)
8
9 case "$1" in
10 start)
11 if [ "$ENABLESETONBOOT" == "on" ]; then
12 boot_mesg "Setting time on booot..."
13 loadproc /usr/local/bin/settime $(cat /var/ipfire/time/settime.conf)
14 fi
15
16 boot_mesg "Starting ntpd..."
17 loadproc /usr/bin/ntpd -Ap /var/run/ntpd.pid
18 ;;
19
20 stop)
21 boot_mesg "Stopping ntpd..."
22 killproc /usr/bin/ntpd
23 ;;
24
25 restart)
26 $0 stop
27 sleep 1
28 $0 start
29 ;;
30
31 status)
32 statusproc /usr/bin/ntpd
33 ;;
34
35 *)
36 echo "Usage: $0 {start|stop|restart|status}"
37 exit 1
38 ;;
39 esac
40
41 # End $rc_base/init.d/ntp