3 # timezone Set time zone information.
4 # chkconfig: 2345 10 70
5 # description: This script is setting time zone information for your machine.
6 # Author: Pawel Wilk <siefca@pld-linux.org>
11 NLS_DOMAIN="rc-scripts"
13 # Source function library.
14 . /etc/rc.d/init.d/functions
16 [ ! -f /etc/sysconfig/timezone ] && exit 0
17 . /etc/sysconfig/timezone
19 ZONE_FILE="$ZONE_INFO_DIR"
21 if [ -n "$ZONE_INFO_SCHEME" -a "$ZONE_INFO_SCHEME" != "posix" ]; then
22 ZONE_FILE="$ZONE_FILE/$ZONE_INFO_SCHEME"
25 if [ -n "$ZONE_INFO_AREA" ]; then
26 ZONE_FILE="$ZONE_FILE/$ZONE_INFO_AREA"
29 ZONE_FILE="$ZONE_FILE/$TIME_ZONE"
31 [ -L /etc/localtime -a "`resolvesymlink /etc/localtime`" = "$ZONE_FILE" ] && exit 0
33 # See how we were called.
37 if [ -f "$ZONE_FILE" ]; then
38 if [ -n "$ZONE_INFO_AREA" ]; then
39 MESSAGE="`nls 'Setting time zone information (%s, %s)' "$ZONE_INFO_AREA" "$TIME_ZONE"`"
41 MESSAGE="`nls 'Setting time zone information (%s)' "$TIME_ZONE"`"
43 run_cmd "$MESSAGE" ln -s $ZONE_FILE /etc/localtime
48 run_cmd "Unsetting time zone information" rm -f /etc/localtime
59 echo "Usage: $0 {start|stop|restart|reload}"
63 unset ZONE_FILE ZONE_INFO_DIR ZONE_INFO_SCHEME ZONE_INFO_AREA TIME_ZONE MESSAGE
67 # This must be last line !
68 # vi:syntax=sh:tw=78:ts=8:sw=4