mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-15 13:44:50 +08:00
Update alpineInit.sh
This commit is contained in:
parent
5d43caf043
commit
045d429ada
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue