Developing lightweight computation at the DSG edge

Commit 94ace863 authored by p4u's avatar p4u
Browse files

This solve a wifi problem detection where ethernet and wlan have the same MAC

parent ab763fca
......@@ -199,6 +199,14 @@ qmp_get_mac_for_dev() {
echo "$mac"
}
# Returns the mac addres for specific device,, only wifi devs are allowed. Useful when eth and wlan have same MAC
# qmp_get_dev_from_wifi_mac 00:22:11:33:44:55
qmp_get_dev_from_wifi_mac() {
mac="$(ip link | grep -A1 -E ": (wifi|wlan|wl).: " | grep -i $1 -B1 | cut -d' ' -f2 | tr -d "\n",:)"
[ -z "$mac" ] && mac="00:00:00:00:00:00"
echo "$mac"
}
#########################
# Other kind of commands
#########################
......
......@@ -394,7 +394,7 @@ qmp_configure_wifi_initial() {
if [ "$configured_mac" == "$m" ]; then
#If we found configured device, we are going to check all needed parameters
found=1
device="$(qmp_get_dev_from_mac $m)"
device="$(qmp_get_dev_from_wifi_mac $m)"
id_configured="$id_configured $j"
echo "Found configured device: $m"
[ -z "$(qmp_uci_get @wireless[$j].mode)" ] && qmp_uci_set @wireless[$j].mode $(qmp_wifi_get_default mode $device)
......@@ -427,7 +427,7 @@ qmp_configure_wifi_initial() {
#Configuring devices not found before
for m in $to_configure; do
device=$(qmp_get_dev_from_mac $m)
device=$(qmp_get_dev_from_wifi_mac $m)
echo "Configuring device: $device | $m"
#Looking for a free slot to put new configuration
j=0
......
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