fix: Simplify conditional check

This commit is contained in:
Kroese 2025-09-21 15:07:25 +02:00 committed by GitHub
parent c81eceaf6f
commit aa89f3a0a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -440,7 +440,7 @@ getInfo() {
IP6=""
# shellcheck disable=SC2143
if [ -f /proc/net/if_inet6 ] && [ -n "$(ifconfig -a | grep inet6)" ]; then
if [ -f /proc/net/if_inet6 && -n "$(ifconfig -a | grep inet6)" ]; then
IP6=$(ip -6 addr show dev "$VM_NET_DEV" scope global up)
[ -n "$IP6" ] && IP6=$(echo "$IP6" | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d' | head -n 1)
fi