From 99f6efc570018e956ccd66008797055d60877e13 Mon Sep 17 00:00:00 2001 From: Molly Lau Date: Mon, 18 Sep 2023 23:51:19 +0900 Subject: [PATCH] Update alpineInit.sh --- Linux_reinstall/Alpine/alpineInit.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Linux_reinstall/Alpine/alpineInit.sh b/Linux_reinstall/Alpine/alpineInit.sh index 164254c..5af6df3 100644 --- a/Linux_reinstall/Alpine/alpineInit.sh +++ b/Linux_reinstall/Alpine/alpineInit.sh @@ -34,6 +34,8 @@ ip6Addr=$(grep "ip6Addr" $confFile | awk '{print $2}') ip6Mask=$(grep "ip6Mask" $confFile | awk '{print $2}') actualIp6Prefix=$(grep "actualIp6Prefix" $confFile | awk '{print $2}') ip6Gate=$(grep "ip6Gate" $confFile | awk '{print $2}') +i6AddrNum=$(grep "i6AddrNum" $confFile | awk '{print $2}') +writeIp6sCmd=$(grep "writeIp6sCmd" $confFile | sed -e 's/writeIpsCmd //g') HostName=$(grep "HostName" $confFile | awk '{print $2}') virtualizationStatus=$(grep "virtualizationStatus" $confFile | awk '{print $2}') setFail2banStatus=$(grep "setFail2banStatus" $confFile | awk '{print $2}') @@ -85,6 +87,9 @@ sed -ri 's/ip6Addr/'${ip6Addr}'/g' /etc/network/interfaces sed -ri 's/ip6Mask/'${ip6Mask}'/g' /etc/network/interfaces sed -ri 's/netmask '${ip6Mask}'/netmask '${actualIp6Prefix}'/g' /etc/network/interfaces sed -ri 's/ip6Gate/'${ip6Gate}'/g' /etc/network/interfaces +if [[ "$i6AddrNum" -ge "2" ]]; then + echo -e "${writeIp6sCmd}" >> /etc/network/interfaces +fi # Restoring access permission. chmod a+x /etc/network/interfaces # Enable IPv6