From 045d429ada48d5937634dc5d092655ae27dfc1bb Mon Sep 17 00:00:00 2001 From: Molly Lau Date: Tue, 19 Sep 2023 19:16:21 +0900 Subject: [PATCH] Update alpineInit.sh --- Linux_reinstall/Alpine/alpineInit.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Linux_reinstall/Alpine/alpineInit.sh b/Linux_reinstall/Alpine/alpineInit.sh index 48471c7..c1f1f84 100644 --- a/Linux_reinstall/Alpine/alpineInit.sh +++ b/Linux_reinstall/Alpine/alpineInit.sh @@ -40,6 +40,7 @@ HostName=$(grep "HostName" $confFile | awk '{print $2}') virtualizationStatus=$(grep "virtualizationStatus" $confFile | awk '{print $2}') setFail2banStatus=$(grep "setFail2banStatus" $confFile | awk '{print $2}') setMotd=$(grep "setMotd" $confFile | awk '{print $2}') +lowMemMode=$(grep "lowMemMode" $confFile | awk '{print $2}') # Reset configurations of repositories true >/etc/apk/repositories @@ -136,12 +137,14 @@ sed -ri 's/ash/bash/g' /etc/passwd # Insall more components. apk update -if [[ "$setFail2banStatus" == "1" ]]; then +if [[ "$setFail2banStatus" == "1" && "$lowMemMode" != "1" ]]; then apk add bind-tools curl e2fsprogs fail2ban grep grub lsblk lsof net-tools udev util-linux vim wget # Config fail2ban sed -i '/^\[Definition\]/a allowipv6 = auto' /etc/fail2ban/fail2ban.conf rc-update add fail2ban /etc/init.d/fail2ban start +elif [[ "$lowMemMode" == "1" ]]; then + apk add bind-tools grep grub net-tools udev util-linux else apk add bind-tools curl e2fsprogs grep grub lsblk lsof net-tools udev util-linux vim wget fi