Update InstallNET.sh

This commit is contained in:
Molly Lau 2023-09-01 21:27:24 +09:00 committed by GitHub
parent d53c3a5122
commit 343e812dcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2124,6 +2124,7 @@ function checkDHCP() {
Network4Config="isDHCP"
[[ `timeout 4s grep -iw "iface" $NetCfgWhole | grep -iw "$interface6" | grep -iw "inet6" | grep -ic "auto\|dhcp"` -ge "1" ]] && Network6Config="isDHCP" || Network6Config="isStatic"
fi
[[ -n $(grep "accept_ra" $NetCfgWhole) ]] && { Network4Config="isStatic"; Network6Config="isStatic"; }
elif [[ "$1" == 'Ubuntu' && "$networkManagerType" == "netplan" ]]; then
# For netplan(Ubuntu 18 and later), if network configuration is Static whether IPv4 or IPv6.
# in "*.yaml" config file, dhcp(4 or 6): no or false doesn't exist is allowed.