#!/bin/sh
# USA, Pacific Time. Daylight saving starts
# second Sunday of March and ends first
# Sunday of November.
timezone="PST8PDT,M3.2.0,M11.1.0"
timeserv=time-nw.nist.gov
timezone_start() {
echo "${timezone}" >/etc/TZ
/usr/sbin/sntp -r ${timeserv}
sleep 1
/usr/sbin/rtc -w
}
timezone_stop() {
echo "Stopping Timezone..."
}
timezone_status() {
cat /etc/TZ
}
case "$1" in
stop)
timezone_stop
;;
restart)
timezone_stop
sleep 1
timezone_start
;;
status)
timezone_status
;;
start)
timezone_start
;;
*)
echo "Usage: $0 start|stop|restart|status"
;;
esac
Make it executable.
chmod a+x timezone.sh
---------------------------------
www.CrazyOutdoorSports.com
No comments:
Post a Comment