aboutsummaryrefslogblamecommitdiffstats
path: root/50-ntpdate
blob: 4e7de9ee2109d7f18e2c84fc4290abbbbd9fd465 (plain) (tree)
1
2
3
4
5
6
7
8
9
         
 
                   
                                                 
                                                       
                                                          
                                                   

                                               


                                                             
                                                                     


                                    
#!/bin/sh

case "${reason}" in
	BOUND|REBIND|REBOOT|RENEW|TIMEOUT|STATIC)
		# sync time as soon as connection is up
		# this reads nameserver from /etc/ntp.conf
		if ! pgrep -x ntpd >/dev/null; then
			ntpd --quit --panicgate
		fi
		# alternatively use ntpdate and give hostname
		#ntpdate -u pool.ntp.org
		;;
	PREINIT|EXPIRE|INFORM|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP)
		# do nothing here...
		;;
esac