#!/bin/sh
. /dtv/SGO.env
#WAIT_NETWORK()
#{
#while [ "$(route -n | grep -c UG)" -lt 1 ] ; do
# echo "SamyGO ntp: wait for network"
# sleep 1
#done
#}
#timezone
#Berlin TZ='CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03'
ln -s /mnt/opt/privateer/usr/libso/Berlin /tmp/CSP_TimeZone
TIMEZONE="GMT-2"
#TZ="set your timezone"
SET_TZ()
{
if [ `cat /dtv/SGO.env | grep -c "export TZ"` -gt 0 ]; then
export TZ='$TIMEZONE'
else
echo "export TZ='$TIMEZONE'" >> /dtv/SGO.env
export TZ='$TIMEZONE'
fi
}
#ntp server
NTP_SERVER='de.pool.ntp.org'
case $1 in
start)
#WAIT_NETWORK
SET_TZ
ntpclient -s -h $NTP_SERVER -p 123
;;
stop)
;;
status)
date
echo TimeZone=$TZ
;;
*)
echo "Usage: $0 {start|status}" 1>&2
exit 0
;;
esac