mirror of
https://github.com/dockur/proxmox.git
synced 2026-07-27 16:54:51 +07:00
feat: Improve bus detection (#72)
This commit is contained in:
+6
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user