2023.11.17

This commit is contained in:
spiritlhl 2023-11-17 15:27:13 +00:00
parent e97c261730
commit 235651e380
2 changed files with 2 additions and 6 deletions

View file

@ -239,10 +239,8 @@ if command -v lshw >/dev/null 2>&1; then
num_lines=$(echo "$output" | wc -l)
if [ $num_lines -eq 1 ]; then
ipv6_prefixlen="$output"
elif [[ "${ipv6_gateway_fe80}" == "N" ]]; then
ipv6_prefixlen=$(echo "$output" | head -n 2 | tail -n 1)
else
ipv6_prefixlen=$(echo "$output" | tail -n 1)
ipv6_prefixlen=$(echo "$output" | head -n 2 | tail -n 1)
fi
if [ -z "$ipv6_prefixlen" ]; then
ipv6_prefixlen=$(ifconfig eth0 | grep -oP 'prefixlen \K\d+' | head -n 1)

View file

@ -881,10 +881,8 @@ if [ ! -f /usr/local/bin/pve_ipv6_prefixlen ] || [ ! -s /usr/local/bin/pve_ipv6_
num_lines=$(echo "$output" | wc -l)
if [ $num_lines -eq 1 ]; then
ipv6_prefixlen="$output"
elif [[ "${ipv6_gateway_fe80}" == "N" ]]; then
ipv6_prefixlen=$(echo "$output" | head -n 2 | tail -n 1)
else
ipv6_prefixlen=$(echo "$output" | tail -n 1)
ipv6_prefixlen=$(echo "$output" | head -n 2 | tail -n 1)
fi
echo "$ipv6_prefixlen" >/usr/local/bin/pve_ipv6_prefixlen
fi