linkpi_firmware_history/rootfs/link/shell/tzone.sh

16 lines
416 B
Bash
Raw Normal View History

2024-02-15 22:07:33 +01:00
if [ ! -f /link/config/misc/timezone/tzselect.json ];then
exit
fi
cfg=/link/config/misc/timezone/tzselect.json
area=`cat $cfg | grep -o '"timeArea":[^(,|})]*' | awk -F: '{print $2}' | sed 's/\"//g'`
city=`cat $cfg | grep -o '"timeCity":[^(,|})]*' | awk -F: '{print $2}' | sed 's/\"//g'`
if [ "$area" = "" -o "$city" = "" ];then
exit
fi
cp /link/config/misc/timezone/zoneinfo/$area/$city /etc/localtime