From c59eb57d92bc1bc88114a22a49802bec42ec891e Mon Sep 17 00:00:00 2001 From: Konano Date: Sat, 22 Jul 2023 16:07:54 +0800 Subject: [PATCH] minor --- init_root.sh | 4 +++- init_sudo.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/init_root.sh b/init_root.sh index dc96771..8540b0c 100755 --- a/init_root.sh +++ b/init_root.sh @@ -163,7 +163,7 @@ configure_hostname() { if [[ $response =~ ^[Yy]$ ]]; then read -p "hostname: " new_hostname - echo $new_hostname | tee /etc/hostname > /dev/null + echo $new_hostname | tee /etc/hostname >/dev/null fi } @@ -176,6 +176,8 @@ configure_timedate() { } configure_fail2ban() { + [ -f /etc/fail2ban/jail.local ] && return + read -p "要配置 fail2ban 吗?[Y]: " response if [[ $response =~ ^[Yy]$ ]]; then diff --git a/init_sudo.sh b/init_sudo.sh index 1a15283..921d0e9 100755 --- a/init_sudo.sh +++ b/init_sudo.sh @@ -163,7 +163,7 @@ configure_hostname() { if [[ $response =~ ^[Yy]$ ]]; then read -p "hostname: " new_hostname - echo $new_hostname | sudo tee /etc/hostname > /dev/null + echo $new_hostname | sudo tee /etc/hostname >/dev/null fi } @@ -176,6 +176,8 @@ configure_timedate() { } configure_fail2ban() { + [ -f /etc/fail2ban/jail.local ] && return + read -p "要配置 fail2ban 吗?[Y]: " response if [[ $response =~ ^[Yy]$ ]]; then