root/usr/local/sbin/ntpdate_sync_once.sh @ 57d1853e
1 |
#!/bin/sh
|
---|---|
2 |
|
3 |
NOTSYNCED="true" |
4 |
SERVER=`cat /cf/conf/config.xml | grep timeservers | cut -d">" -f2 | cut -d"<" -f1` |
5 |
|
6 |
while [ "$NOTSYNCED" = "true" ]; do |
7 |
ntpdate $SERVER |
8 |
if [ "$?" = "0" ]; then |
9 |
NOTSYNCED="false" |
10 |
fi
|
11 |
sleep 5 |
12 |
done
|
13 |
|
14 |
# Launch -- we have net.
|
15 |
killall ntpd 2>/dev/null |
16 |
sleep 1
|
17 |
/usr/local/sbin/ntpd -s -f /var/etc/ntpd.conf |