jazzbiker:
Well, in my TC CorePlus 11.0 version I haven't /etc/ntpd.conf, I've
/etc/sysconfig/ntpserver.
All this theme is a bit more difficult it seems (for me) and for this reason I decided to change the time directly with a single command.
Robert Shingledecker first and Bela Marcus after made the
/etc/init.d/settime.sh:
#!/bin/sh
# (c) Robert Shingledecker 2012
# Bela Markus 2015
# Wait for network to come up and then set time
CNT=0
until ifconfig | grep -q Bcast
do
[ $((CNT++)) -gt 60 ] && break || sleep 1
done
if [ $CNT -le 60 ]
then
CNT=9999
NRT=0
while sleep 0
do
XXX=$(/bin/date -I)
XXX=${XXX:0:4}
if [ "$XXX" -ge "2015" ];
then
break
fi
if [ $CNT -gt 10 ];
then
/usr/bin/getTime.sh
if [ $NRT -gt 5 ];
then
break
fi
CNT=0
NRT=$((NRT+1))
fi
CNT=$((CNT+1))
sleep 1
done
fi
I changed the line
if [ "$XXX" -ge "2015" ]; with
if [ "$XXX" -ge "2021" ];Now looks that it forks to another script named /usr/bin/getTime.sh . With the above correction If the year is less than "2021" the script forks to the getTime.sh (made by Bela Markus too) is:
#!/bin/busybox ash
# bmarkus - 26/02/2014
NTPSERVER=$(cat /etc/sysconfig/ntpserver)
/usr/sbin/ntpd -q -p $NTPSERVER
Finally It forks (again) to an another script named /etc/sysconfig/ntpserver which It contents only this:
pool.ntp.org
I changed with your suggestion (but for Spain) with:
server 0.es.pool.ntp.org
server 1.es.pool.ntp.org
server 2.es.pool.ntp.org
server 3.es.pool.ntp.org
I don't know If now works (because my clock was changed before). Surely yes... Tomorrow we'll know it