Update alpineInit.sh

This commit is contained in:
Molly Lau 2023-09-19 19:16:21 +09:00 committed by GitHub
parent 5d43caf043
commit 045d429ada
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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