diff --git a/init_root.sh b/init_root.sh index c28f609..4f9c32c 100755 --- a/init_root.sh +++ b/init_root.sh @@ -167,6 +167,14 @@ configure_hostname() { fi } +configure_timedate() { + read -p "要修改 时区 吗?[N]: " response + + if [[ $response =~ ^[Yy]$ ]]; then + timedatectl set-timezone Asia/Shanghai + fi +} + if [[ $EUID -ne 0 ]]; then echo "This script must be run as root." exit 1 @@ -183,3 +191,4 @@ configure_zsh configure_tmux configure_iptables # configure_hostname +configure_timedate diff --git a/init_sudo.sh b/init_sudo.sh index fa5ab0d..a20878c 100755 --- a/init_sudo.sh +++ b/init_sudo.sh @@ -167,6 +167,14 @@ configure_hostname() { fi } +configure_timedate() { + read -p "要修改 时区 吗?[N]: " response + + if [[ $response =~ ^[Yy]$ ]]; then + sudo timedatectl set-timezone Asia/Shanghai + fi +} + if [[ $EUID -eq 0 ]]; then echo "This script should not be run as root." exit 1 @@ -183,3 +191,4 @@ configure_zsh configure_tmux configure_iptables # configure_hostname +configure_timedate