From b091ef6b1528d777cf6812feac3fbde92c9ac090 Mon Sep 17 00:00:00 2001 From: huangtuq Date: Mon, 17 Apr 2023 12:35:24 +0800 Subject: [PATCH] update time zone info Signed-off-by: huangtuq --- script/server/init.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/script/server/init.sh b/script/server/init.sh index 2c76e24c..2e4507d5 100644 --- a/script/server/init.sh +++ b/script/server/init.sh @@ -82,6 +82,16 @@ update_global_config() { sed "s/SERVER_PUBLIC_IP: 127.0.0.1/SERVER_PUBLIC_IP: $SERVER_PUBLIC_IP/g" -i ${SYSOM_CONF} sed "s/SERVER_PORT: 80/SERVER_PORT: $SERVER_PORT/g" -i ${SYSOM_CONF} sed "s/global_root_path \/usr\/local\/sysom/global_root_path $APP_HOME/g" -i ${SYSOM_CONF} + + ###update local timezone### + local_timezone=`timedatectl status | grep "Time zone" | awk '{print $3}'` + green "current timezone is : $local_timezone" + if [ "$local_timezone" == "" ] + then + echo "get time zone fail, use default time zone Asia/Shanghai" + else + sed "s;Asia/Shanghai;$local_timezone;g" -i ${SYSOM_CONF} + fi } do_init_servers() @@ -94,6 +104,7 @@ do_init_servers() then generate_service_env update_global_config + exit 1 for dir in `cat $config` do if [ -e ${dir}/init.sh ] -- Gitee