From c33441c4f4889e156d9097688de7a73c69550b24 Mon Sep 17 00:00:00 2001 From: Konano Date: Sat, 22 Jul 2023 15:52:21 +0800 Subject: [PATCH] add configure_timedate --- init_root.sh | 9 +++++++++ init_sudo.sh | 9 +++++++++ 2 files changed, 18 insertions(+) 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