4 # Modified this script to use the usn pool from pool.ntp.org. More
5 # Info on this can be found at the project page: http://www.pool.ntp.org/zone/us
7 if [ -d /proc
/sys
/xen
]; then
8 echo 1 > /proc
/sys
/xen
/independent_wallclock
;
11 servers
='0.us.pool.ntp.org 1.us.pool.ntp.org 2.us.pool.ntp.org 3.us.pool.ntp.org'
14 /usr
/sbin
/ntpdate
$servers >/dev
/null
2>&1
17 if [ $rc -ne 0 ] ; then
18 /usr
/sbin
/ntpdate
$servers 2>&1 \
19 |
grep -q ': the NTP socket is in use, exiting$'
20 if [ $?
-eq 0 ] ; then
21 exit 0 # machine is running NTP daemon
23 for backoff
in 15 30 60 300 ; do
25 /usr
/sbin
/ntpdate
$servers >/dev
/null
2>&1
27 [ $rc -eq 0 ] && break
31 if [ $rc -ne 0 ] ; then
32 echo "ntpdate failed, trying again"
33 # try again, and be verbose
36 /usr
/sbin
/ntpdate
$servers 2>&1
37 if [ $?
-ne 0 ] ; then
42 /usr
/sbin
/ntpdate
$server 2>&1
43 if [ $?
-ne 0 ] ; then
49 if [ -e /dev
/rtc
]; then