<span>timezone配置</span>
####################################################### # timezone 设置为亚洲上海时区,时区统一配置,很重要的系统参数 ####################################################### function timezone_check() { echo "" echo -e "\033[32m ******************************* \033[0m" echo -e "\033[32m timezone_check, pass... \033[0m" echo -e "\033[32m ******************************* \033[0m"} local timezone=$(date -R | awk '{print $NF}') local timezfile="/usr/share/zoneinfo/Asia/Shanghai" if [ "$timezone" != "+0800" ]; then echo "System timezone is $timezone" if [ -e "/etc/localtime" ]; then mv /etc/localtime /etc/localtime.bak fi ln -s $timezfile /etc/localtime echo "System timezone change to $(date -R | awk '{print $NF}')" else echo "System timezone is $timezone(BeiJing) timezone" fi }