#-------------------------------------------------------------------- # /etc/rc.d/rc900.ntp - create ntp configuration # # Creation: 10.03.2004 Claas Hilbrecht # Last Update: $Id$ #-------------------------------------------------------------------- if [ "$OPT_NTP" = "yes" ] then begin_script ntp "starting ntp daemon..." # add ntp services to /etc/services. # this is REQUIRED for ntpd to work! echo "ntp 123/udp" >> /etc/services [ ! -e /etc/ntp.peers ] && echo "#" > /etc/ntp.peers [ ! -e /etc/ntp.pool ] && echo "#" > /etc/ntp.pool if [ $NTP_REFCLOCK_TYPE != none ] then case $NTP_REFCLOCK_DEVICE in ttyS*) setserial /dev/NTP_REFCLOCK_DEVICE low_latency ;; esac case $NTP_REFCLOCK_TYPE in mouseclock-nts) ln -s /dev/$NTP_REFCLOCK_DEVICE /dev/refclock-0 echo "server 127.127.8.0 mode 14 iburst" > /etc/ntp.refclock ;; mouseclock-usb-ii) ln -s /dev/ttyUSB0 /dev/refclock-0 echo "server 127.127.8.0 mode 19 iburst" > /etc/ntp.refclock ;; sure) ln -s /dev/$NTP_REFCLOCK_DEVICE /dev/refclock-0 echo "server 127.127.8.0 mode 14 iburst" > /etc/ntp.refclock ;; hopf-seriell) ln -s /dev/$NTP_REFCLOCK_DEVICE /dev/refclock-0 echo "server 127.127.8.0 mode 12 iburst" > /etc/ntp.refclock ;; neoclock4x) ln -s /dev/$NTP_REFCLOCK_DEVICE /dev/neoclock4x-0 cat <>/etc/ntp.refclock server 127.127.44.0 iburst # use CMOS clock to sync 1=enable 0=disable fudge 127.127.44.0 flag1 0 # use CMOS clock even it wasn't synced before (dangerous!) 1=enable 0=disable fudge 127.127.44.0 flag2 0 # 1=enable extensive logging fudge 127.127.44.0 flag4 1 EOF ;; *) ;; esac fi # service-restart.sh 1 /usr/sbin/ntpd -g & ntpd -g if [ $NTP_CHECK_STATUS = yes ] then echo "ntp_firstsync=yes" > /var/run/ntp_firstsync httpd-menu.sh add -p 300 status_ntp.cgi NTP '$_MT_stat' status service-restart.sh 1 /usr/bin/check_ntp_status $NTP_REFCLOCK_TYPE $NTP_SHOW_STATUS_VIA_LED & fi end_script fi