diff --git a/manage-lxc-vm-notes.sh b/manage-lxc-vm-notes.sh index 32a80e5..a78671a 100755 --- a/manage-lxc-vm-notes.sh +++ b/manage-lxc-vm-notes.sh @@ -97,7 +97,7 @@ collect_lxc_summary() { # Prefer iproute2 global IPv4 addresses ip -o -4 addr show up scope global 2>/dev/null | awk "{print \$4}" || true; # Fallbacks - hostname -I 2>/dev/null || true; + hostname -i 2>/dev/null || true; ip -4 addr 2>/dev/null | awk "/inet /{print \$2}" || true; ifconfig 2>/dev/null | awk "/inet (addr:)?/{print \$2}" | sed "s/^addr://" || true; ip route get 1 2>/dev/null | awk "{for(i=1;i<=NF;i++) if (\$i==\"src\") print \$(i+1)}" || true;