Developing lightweight computation at the DSG edge

Commit 58c35c64 authored by Simó Albert i Beltran's avatar Simó Albert i Beltran
Browse files

Improve qmp_get_dev_from_mac function.

parent aaba5ee6
...@@ -194,7 +194,7 @@ qmp_get_dev_from_mac() { ...@@ -194,7 +194,7 @@ qmp_get_dev_from_mac() {
# Returns the mac address of the device # Returns the mac address of the device
# qmp_get_mac_for_dev eth0 # qmp_get_mac_for_dev eth0
qmp_get_mac_for_dev() { qmp_get_mac_for_dev() {
mac="$(ip link show dev $1 | grep -m 1 "link/ether" | awk '{print $2}')" mac="$(cat /sys/class/net/$1/address)"
[ -z "$mac" ] && mac="00:00:00:00:00:00" [ -z "$mac" ] && mac="00:00:00:00:00:00"
echo "$mac" echo "$mac"
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment