]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/initscripts/init.d/ntp
Fix type /etc/init.d/ntp (booot).
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / ntp
CommitLineData
91dc1bfc
MT
1#!/bin/sh
2# Begin $rc_base/init.d/ntp
3
91dc1bfc
MT
4. /etc/sysconfig/rc
5. $rc_functions
6
ed0a0ba8
CS
7eval $(/usr/local/bin/readhash /var/ipfire/time/settings)
8
91dc1bfc
MT
9case "$1" in
10 start)
ed0a0ba8 11 if [ "$ENABLESETONBOOT" == "on" ]; then
88d701e2 12 boot_mesg "Setting time on boot..."
ed0a0ba8
CS
13 loadproc /usr/local/bin/settime $(cat /var/ipfire/time/settime.conf)
14 fi
15
91dc1bfc 16 boot_mesg "Starting ntpd..."
6f300951 17 loadproc /usr/bin/ntpd -Ap /var/run/ntpd.pid
91dc1bfc
MT
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 ;;
39esac
40
41# End $rc_base/init.d/ntp