feat: Improve bus detection (#72)

This commit is contained in:
Kroese
2026-07-05 18:52:12 +02:00
committed by GitHub
parent b12fc815e9
commit 7a2a6215ee
+6 -4
View File
@@ -404,12 +404,14 @@ getInfo() {
[ -n "$IP6" ] && IP6=$(echo "$IP6" | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d' | head -n 1)
fi
local result bus
result=$(ethtool -i "$DEV")
local nic="" bus="" result=""
result=$(ethtool -i "$DEV" 2>/dev/null || :)
nic=$(grep -m 1 -i 'driver:' <<< "$result" | awk '{print $2}')
bus=$(grep -m 1 -i 'bus-info:' <<< "$result" | awk '{print $2}')
if [[ "${bus,,}" != "" && "${bus,,}" != "n/a" && "${bus,,}" != "tap" ]]; then
[[ "$DEBUG" == [Yy1]* ]] && info "Detected BUS: $bus"
if [[ -n "$bus" && "${bus,,}" != "n/a" && "${bus,,}" != "tap" ]]; then
enabled "$DEBUG" && info "Detected NIC: ${nic:-unknown} BUS: $bus"
error "This container does not support host mode networking!"
exit 29
fi