tizen 2.4 release
[framework/base/tizen-locale.git] / packaging / tzdata-update
1 #!/bin/bash
2
3 CLOCK=/etc/sysconfig/clock
4
5 if [ ! -e $CLOCK ]; then
6     exit
7 fi
8
9 # Read existing zone name from config
10 # Cut 'Asia/Seoul' from line 'ZONE="Asia/Seoul"  UTC=True'
11 while read line
12 do
13         if [ ! -z "${line##*ZONE*}" ]; then
14                 continue
15         fi
16         zonename=$(echo $line | sed -e 's#^[[:space:]]*ZONE[[:space:]]*=[[:space:]]*"\?\([^[:space:]\n"]*\).*#\1#')
17         zonefile="/usr/share/zoneinfo/${zonename}"
18         break
19 done < $CLOCK
20
21 if [ -e /etc/localtime ]; then
22     cp ${zonefile} /etc/localtime
23 fi