diff options
author | Josep Puigdemont <josep.puigdemont@linaro.org> | 2016-10-21 17:34:33 +0200 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2017-01-03 13:55:29 +0000 |
commit | 69bca04bc21886fd228f2e37e075b1d9f3f069db (patch) | |
tree | bc6eac3ca21982244af226e564191b1af3a0a86b /automated | |
parent | 15ce297f505de9c89d7acfa9219808b4fb463c9e (diff) |
get_vland_pci_dev.sh: return the PCI device
Change-Id: If0ac3a702528d97f536513e35a1f65be43f15a27
Signed-off-by: Josep Puigdemont <josep.puigdemont@linaro.org>
Diffstat (limited to 'automated')
-rwxr-xr-x | automated/utils/vland/get_vland_pci_dev.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/automated/utils/vland/get_vland_pci_dev.sh b/automated/utils/vland/get_vland_pci_dev.sh new file mode 100755 index 0000000..2c9726d --- /dev/null +++ b/automated/utils/vland/get_vland_pci_dev.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +vland_name=${1} + +iface=$("$(readlink -f "$(dirname "$0")")"/get_vland_interface.sh "${vland_name}") +if [ -L "/sys/class/net/${iface}/device" ]; then + basename "$(readlink -f "/sys/class/net/${iface}/device")" +else + exit 1 +fi |