2 # Begin $rc_base/init.d/ntp
7 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/time
/settings
)
11 if [ "$ENABLESETONBOOT" == "on" ]; then
12 boot_mesg
-n "Setting time on boot..."
13 pidof wpa_supplicant dhcpcd
2>&1 > /dev
/null
14 if [ "${?}" == "0" ]; then
15 if [ ! -e /var
/ipfire
/red
/active
]; then
17 boot_mesg
-n "Waiting for red connection"
18 for (( i
=30; i
>1; i--
)) do
19 if [ -e /var
/ipfire
/red
/active
]; then
28 if [ -e /var
/ipfire
/red
/active
]; then
31 host ping.ipfire.org
> /dev
/null
2>&1
32 if [ "${?}" != "0" ]; then
33 boot_mesg
"DNS not work ... init with ntp.ipfire.org at 81.3.27.46 ..."
34 loadproc
/usr
/local
/bin
/settime
81.3.27.46
35 boot_mesg
"Setting time on boot..."
38 loadproc
/usr
/local
/bin
/settime $
(cat /var
/ipfire
/time
/settime.conf
)
40 boot_mesg
" ERROR! Not online!"
45 boot_mesg
"Starting ntpd..."
46 loadproc
/usr
/bin
/ntpd
-Ap /var
/run
/ntpd.pid
50 boot_mesg
"Stopping ntpd..."
51 killproc
/usr
/bin
/ntpd
61 statusproc
/usr
/bin
/ntpd
65 echo "Usage: $0 {start|stop|restart|status}"
70 # End $rc_base/init.d/ntp