generate-ldif: Skip some odd ethernet devices

This commit is contained in:
Benoît S. 2020-06-30 04:36:04 +02:00 committed by Gitea
parent 5101547242
commit 8b34bec22b
1 changed files with 3 additions and 0 deletions

View File

@ -276,7 +276,10 @@ for net in $(ls /sys/class/net); do
echo $path | grep -q virtual
if [ $? -ne 0 ]; then
hw=$(cat ${path}/address)
# In some cases some devices does not have a vendor or device, skip it
test -f ${path}/device/vendor || continue
vendor_id=$(cat ${path}/device/vendor)
test -f ${path}/device/device || continue
dev_id=$(cat ${path}/device/device)
[ "${dev_id}" = "0x0001" ] && dev_id="0x1000"
dev=$(lspci -d "${vendor_id}:${dev_id}" -vm)