Commit 762d5a5d authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Jakob Olsson
Browse files

map-agent: fix configuring ssid's and keys with spaces

parent abc997d3
......@@ -44,9 +44,9 @@ brcm_sync_credentials() {
[ "$section" == "" ] && return
uci set ieee1905.${section}.band=$band
uci set ieee1905.${section}.ssid=$ssid
uci set ieee1905.${section}.ssid="$ssid"
uci set ieee1905.${section}.encryption=$encryption
uci set ieee1905.${section}.key=$key
uci set ieee1905.${section}.key="$key"
}
mapagent_process_radio() {
......@@ -91,8 +91,8 @@ brcm_write_credentials() {
write_wireless() {
local section=$1
local map_ifname=$2
local bk_ssid=$3
local bk_key=$4
local bk_ssid="$3"
local bk_key="$4"
config_get ifname $section ifname
......@@ -100,21 +100,21 @@ brcm_write_credentials() {
[ "$ifname" != "$map_ifname" ] && return
#echo applying bk_ssid = $bk_ssid bk_key = $bk_key
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
uci -q set wireless.${section}.multi_ap_backhaul_ssid="$bk_ssid"
uci -q set wireless.${section}.multi_ap_backhaul_key="$bk_key"
}
config_load wireless
config_foreach write_wireless wifi-iface $1 $2 $3
config_foreach write_wireless wifi-iface "$1" "$2" "$3"
}
mapagent_find_fbss() {
local section=$1
local dev=$2
local bk_ssid=$3
local bk_key=$4
local bk_ssid="$3"
local bk_key="$4"
config_get device $section device
config_get multi_ap $section multi_ap "0"
......@@ -126,10 +126,10 @@ brcm_write_credentials() {
config_get ifname $section ifname
#echo applying bk_ssid = $bk_ssid bk_key = $bk_key
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
# subshell in hopes to maintain mapagent config loaded
$(mapagent_apply_wireless $ifname $bk_ssid $bk_key)
echo $(mapagent_apply_wireless $ifname "$bk_ssid" "$bk_key") 2> /dev/null
}
mapagent_find_bbss() {
......@@ -149,9 +149,9 @@ brcm_write_credentials() {
config_get ssid $1 ssid
config_get key $1 key
#echo found ssid=$ssid key=$key
#echo found ssid="$ssid" key="$key"
config_foreach mapagent_find_fbss fh-iface $dev $ssid $key
config_foreach mapagent_find_fbss fh-iface $dev "$ssid" "$key"
}
mapagent_process_radio() {
......@@ -334,8 +334,8 @@ brcm_bsta_to_wireless() {
apply_config() {
local section=$1
local bsta=$2
local ssid=$3
local key=$4
local ssid="$3"
local key="$4"
local encryption=$5
local enabled=$6
local disabled="0"
......@@ -346,8 +346,8 @@ brcm_bsta_to_wireless() {
[ "$bsta" == "$ifname" ] || return
uci set wireless.${section}.ssid=$ssid
uci set wireless.${section}.key=$key
uci set wireless.${section}.ssid="$ssid"
uci set wireless.${section}.key="$key"
uci set wireless.${section}.encryption=$encryption
uci set wireless.${section}.disabled=$disabled
echo 1
......@@ -371,7 +371,7 @@ brcm_bsta_to_wireless() {
config_get encryption $1 encryption
config_get enabled $1 enabled "0"
echo "$(mapagent_apply_wl_bsta $2 $ssid $key $encryption $4)"
echo $(mapagent_apply_wl_bsta $2 "$ssid" "$key" $encryption $4) 2> /dev/null
}
config_get band $1 band
......@@ -386,7 +386,7 @@ brcm_bsta_to_wireless() {
config_get key $1 key
config_get encryption $1 encryption
echo "$(mapagent_apply_wl_bsta $ifname $ssid $key $encryption $enabled)"
echo $(mapagent_apply_wl_bsta $ifname "$ssid" "$key" $encryption $enabled) 2> /dev/null
fi
}
......
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