Files
paqctl/paqctl.sh
SamNet-dev fcc18542f3 fix: handle OpenVZ network detection (Issue #25)
OpenVZ containers use a different route format:
- Standard: "default via 192.168.1.1 dev eth0"
- OpenVZ:   "default dev venet0 scope link"

The old code used awk '{print $5}' which returned "link" instead
of "venet0" on OpenVZ, causing the script to fail silently when
trying to get IP info from a non-existent "link" interface.

Changes:
- Parse route format to detect "via" vs "dev" patterns
- Use appropriate awk field based on route type
- Validate detected interface exists before using it
- Handle OpenVZ having no gateway (no "via" in route)
- Wrap IP detection pipeline in subshell with || true
2026-02-05 09:52:24 -06:00

269 KiB