Update install_pve.sh

This commit is contained in:
spiritlhl 2023-08-27 08:36:52 +08:00 committed by GitHub
parent 93cc4bbecc
commit c821bdd767
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -802,6 +802,9 @@ if [ ! -f /usr/local/bin/pve_ipv6_prefixlen ] || [ ! -s /usr/local/bin/pve_ipv6_
fi
if [ ! -f /usr/local/bin/pve_ipv6_gateway ] || [ ! -s /usr/local/bin/pve_ipv6_gateway ] || [ "$(sed -e '/^[[:space:]]*$/d' /usr/local/bin/pve_ipv6_gateway)" = "" ]; then
ipv6_gateway=$(ip -6 route show | awk '/default via/{print $3}' | head -n1)
if [[ "${ipv6_gateway: -2}" == "::" ]]; then
ipv6_gateway="${ipv6_gateway}0000"
fi
echo "$ipv6_gateway" >/usr/local/bin/pve_ipv6_gateway
fi
ipv6_address=$(cat /usr/local/bin/pve_check_ipv6)