Update InstallNET.sh

This commit is contained in:
Molly Lau 2023-10-01 06:33:16 +09:00 committed by GitHub
parent 521dd39042
commit ec9df2dc8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1795,7 +1795,7 @@ function writeMultipleIpv4Addresses() {
done done
writeIpsCmd=$(echo $tmpWriteIpsCmd) writeIpsCmd=$(echo $tmpWriteIpsCmd)
SupportMultipleIPv4="$writeIpsCmd" SupportMultipleIPv4="$writeIpsCmd"
elif [[ "$targetRelese" == 'Ubuntu' ]]; then elif [[ "$targetRelese" == 'Ubuntu' ]] || [[ "$targetRelese" == 'AlmaLinux' ]] || [[ "$targetRelese" == 'Rocky' ]]; then
for writeIps in ${iAddrs[@]}; do for writeIps in ${iAddrs[@]}; do
ipAddrItem="$writeIps" ipAddrItem="$writeIps"
tmpWriteIpsCmd+=''$ipAddrItem',' tmpWriteIpsCmd+=''$ipAddrItem','
@ -1944,7 +1944,7 @@ function writeMultipleIpv6Addresses() {
addFirstIpv6Config=''$2' sed -i '\''$aiface '$interface6' inet6 static'\'' '$3'; '$2' sed -i '\''$a\\taddress '$i6Addr''\'' '$3'; '$2' sed -i '\''$a\\tgateway '$ip6Gate''\'' '$3'; '$2' sed -i '\''$a\\tdns-nameservers '$ip6DNS''\'' '$3';' addFirstIpv6Config=''$2' sed -i '\''$aiface '$interface6' inet6 static'\'' '$3'; '$2' sed -i '\''$a\\taddress '$i6Addr''\'' '$3'; '$2' sed -i '\''$a\\tgateway '$ip6Gate''\'' '$3'; '$2' sed -i '\''$a\\tdns-nameservers '$ip6DNS''\'' '$3';'
SupportMultipleIPv6=''$addIpv6Adapter' '$addFirstIpv6Config' '$writeIp6sCmd' '$preferIpv6Access'' SupportMultipleIPv6=''$addIpv6Adapter' '$addFirstIpv6Config' '$writeIp6sCmd' '$preferIpv6Access''
} }
elif [[ "$targetRelese" == 'Ubuntu' ]]; then elif [[ "$targetRelese" == 'Ubuntu' ]] || [[ "$targetRelese" == 'AlmaLinux' ]] || [[ "$targetRelese" == 'Rocky' ]]; then
for writeIp6s in ${i6Addrs[@]}; do for writeIp6s in ${i6Addrs[@]}; do
ip6AddrItem="$writeIp6s" ip6AddrItem="$writeIp6s"
tmpWriteIp6sCmd+=''$ip6AddrItem',' tmpWriteIp6sCmd+=''$ip6AddrItem','
@ -3699,12 +3699,12 @@ chmod a+x \\\$sysroot/etc/profile.d/motd.sh"`
# Download "interfaces" templates and replace IP details. # Download "interfaces" templates and replace IP details.
wget --no-check-certificate -O \$sysroot/etc/network/tmp_interfaces ${AlpineNetworkConf} wget --no-check-certificate -O \$sysroot/etc/network/tmp_interfaces ${AlpineNetworkConf}
# Config nameservers # Config nameservers.
rm -rf \$sysroot/etc/resolv.conf rm -rf \$sysroot/etc/resolv.conf
wget --no-check-certificate -O \$sysroot/etc/resolv.conf ${AlpineDnsFile} wget --no-check-certificate -O \$sysroot/etc/resolv.conf ${AlpineDnsFile}
chmod a+x \$sysroot/etc/resolv.conf chmod a+x \$sysroot/etc/resolv.conf
# Add customized motd # Add customized motd.
${ModifyMOTD} ${ModifyMOTD}
# Creat a modify initial file. # Creat a modify initial file.
@ -3716,9 +3716,12 @@ echo "IncDisk "${IncDisk} >> \$sysroot/root/alpine.config
# To determine mirror. # To determine mirror.
echo "LinuxMirror "${LinuxMirror} >> \$sysroot/root/alpine.config echo "LinuxMirror "${LinuxMirror} >> \$sysroot/root/alpine.config
# To determine release of Alpine Linux # To determine release of Alpine Linux.
echo "alpineVer "${DIST} >> \$sysroot/root/alpine.config echo "alpineVer "${DIST} >> \$sysroot/root/alpine.config
# To determine release of Redhat.
echo "RedHatSeries "${RedHatSeries} >> \$sysroot/root/alpine.config
# To determine target system mirror. # To determine target system mirror.
echo "targetLinuxMirror "${targetLinuxMirror} >> \$sysroot/root/alpine.config echo "targetLinuxMirror "${targetLinuxMirror} >> \$sysroot/root/alpine.config
@ -3743,7 +3746,7 @@ echo "sshPORT "${sshPORT} >> \$sysroot/root/alpine.config
# To determine network adapter name. # To determine network adapter name.
echo "networkAdapter "${networkAdapter} >> \$sysroot/root/alpine.config echo "networkAdapter "${networkAdapter} >> \$sysroot/root/alpine.config
# To determine IPv4 static config # To determine IPv4 static config.
echo "IPv4 "${IPv4} >> \$sysroot/root/alpine.config echo "IPv4 "${IPv4} >> \$sysroot/root/alpine.config
echo "MASK "${MASK} >> \$sysroot/root/alpine.config echo "MASK "${MASK} >> \$sysroot/root/alpine.config
echo "ipPrefix "${ipPrefix} >> \$sysroot/root/alpine.config echo "ipPrefix "${ipPrefix} >> \$sysroot/root/alpine.config
@ -3757,7 +3760,7 @@ echo "ipDNS2 "${ipDNS2} >> \$sysroot/root/alpine.config
echo "iAddrNum "${iAddrNum} >> \$sysroot/root/alpine.config echo "iAddrNum "${iAddrNum} >> \$sysroot/root/alpine.config
echo "writeIpsCmd "'''${writeIpsCmd}''' >> \$sysroot/root/alpine.config echo "writeIpsCmd "'''${writeIpsCmd}''' >> \$sysroot/root/alpine.config
# To determine Ipv6 static config # To determine Ipv6 static config.
echo "ip6Addr "${ip6Addr} >> \$sysroot/root/alpine.config echo "ip6Addr "${ip6Addr} >> \$sysroot/root/alpine.config
echo "ip6Mask "${ip6Mask} >> \$sysroot/root/alpine.config echo "ip6Mask "${ip6Mask} >> \$sysroot/root/alpine.config
echo "actualIp6Prefix "${actualIp6Prefix} >> \$sysroot/root/alpine.config echo "actualIp6Prefix "${actualIp6Prefix} >> \$sysroot/root/alpine.config
@ -3767,28 +3770,28 @@ echo "ip6DNS2 "${ip6DNS2} >> \$sysroot/root/alpine.config
echo "i6AddrNum "${i6AddrNum} >> \$sysroot/root/alpine.config echo "i6AddrNum "${i6AddrNum} >> \$sysroot/root/alpine.config
echo "writeIp6sCmd "'''${writeIp6sCmd}''' >> \$sysroot/root/alpine.config echo "writeIp6sCmd "'''${writeIp6sCmd}''' >> \$sysroot/root/alpine.config
# To determine whether to disable IPv6 modules # To determine whether to disable IPv6 modules.
echo "setIPv6 "${setIPv6} >> \$sysroot/root/alpine.config echo "setIPv6 "${setIPv6} >> \$sysroot/root/alpine.config
# To determine hostname # To determine hostname.
echo "HostName "${HostName} >> \$sysroot/root/alpine.config echo "HostName "${HostName} >> \$sysroot/root/alpine.config
# To determine whether in virtual or physical machine # To determine whether in virtual or physical machine.
echo "virtualizationStatus "${virtualizationStatus} >> \$sysroot/root/alpine.config echo "virtualizationStatus "${virtualizationStatus} >> \$sysroot/root/alpine.config
# To determine whether configure fail2ban # To determine whether configure fail2ban.
echo "setFail2banStatus "${setFail2banStatus} >> \$sysroot/root/alpine.config echo "setFail2banStatus "${setFail2banStatus} >> \$sysroot/root/alpine.config
# To determine whether to delete motd of original system # To determine whether to delete motd of original system.
echo "setMotd "${setMotd} >> \$sysroot/root/alpine.config echo "setMotd "${setMotd} >> \$sysroot/root/alpine.config
# To determine whether low memory mode so that reduce preconditioning components to make sure installation succeed on 768MB and lower. # To determine whether low memory mode so that reduce preconditioning components to make sure installation succeed on 768MB and lower.
echo "lowMemMode "${lowMemMode} >> \$sysroot/root/alpine.config echo "lowMemMode "${lowMemMode} >> \$sysroot/root/alpine.config
# To determine dd image url # To determine dd image url.
echo "DDURL "${DDURL} >> \$sysroot/root/alpine.config echo "DDURL "${DDURL} >> \$sysroot/root/alpine.config
# To determine cloud init url # To determine cloud init url.
echo "cloudInitUrl "${cloudInitUrl} >> \$sysroot/root/alpine.config echo "cloudInitUrl "${cloudInitUrl} >> \$sysroot/root/alpine.config
# Download initial file. # Download initial file.