summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlias Apalodimas <ilias.apalodimas@linaro.org>2019-05-18 14:42:00 +0300
committerIlias Apalodimas <ilias.apalodimas@linaro.org>2019-05-18 17:02:34 +0300
commitf393ce4ea2d7bd952627aea49885429b62106838 (patch)
treed53ac05ca5b081d9e1c294c35b564949da04574b
parent1158f1d35a91f5690579a3c8805c6cd741d50b54 (diff)
downloadlava-sessions-f393ce4ea2d7bd952627aea49885429b62106838.tar.gz
fix networking scripts after lavad changes
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rwxr-xr-xscripts/lava-common.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/lava-common.sh b/scripts/lava-common.sh
index 8b3eacd..0542837 100755
--- a/scripts/lava-common.sh
+++ b/scripts/lava-common.sh
@@ -12,9 +12,10 @@ lava_result() {
find_vland_iface() {
# lv must match lava vlan name
lv='vlan_one'
- pattern=$(lava-vland-names | awk -F ',' -v vlan="$lv" '$0 ~ vlan {print $2}')
+ pattern=$(lava-vland-names | awk -F ',' -v vlan=$lv '$0 ~ vlan {print $2}' | awk -F '\' '{print $1}')
+ pattern=$(printf '%s' "$pattern" | sed 's/[.[(+)]/\\&/g')
- iface_str=$(lava-vland-self | grep "$pattern")
+ iface_str=$(lava-vland-self | awk -v pat="$pattern" 'match($0,pat){print substr($0,RSTART,50)}')
mac=$(echo $iface_str | awk -F ',' '{print $2}')
for i in $(ls /sys/class/net/); do
new_mac=$(cat /sys/class/net/"$i"/address)