1234567891011121314151617181920212223242526272829303132333435 |
- INTERFACE="${1:-06/01/01}"
- BASENAME=${DEVPATH##*/}
- for d in /sys/${DEVPATH}/${BASENAME}:*; do
- [[ -d ${d} ]] || continue
- INTERFACEID="$(< ${d}/bInterfaceClass)"
- INTERFACEID="${INTERFACEID}/$(< ${d}/bInterfaceSubClass)"
- INTERFACEID="${INTERFACEID}/$(< ${d}/bInterfaceProtocol)"
- #echo ${d}: ${INTERFACEID}
- if [[ ${INTERFACE} == ${INTERFACEID} ]]; then
- # Found interface
- exit 0
- fi
- done
-
- exit 1
|