fff-hoods/fff-wireless: Don't delete WiFi devices

We only want to remove WiFi interfaces, not devices during
reconfiguration. This still allows for complete reconfiguration,
but does not remove device attributes like a disabled 5 GHz or
similar.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
This commit is contained in:
Adrian Schmutzler 2017-11-02 14:31:15 +01:00 committed by Tim Niemeyer
parent 46d8b9b8b2
commit 72942057bc
2 changed files with 17 additions and 2 deletions

View File

@ -81,7 +81,7 @@ else
rm -f "$sectorcopy" # always delete: no broadcast for isolated device
rm -f "$sectortmp"
if ! wifiDelAll; then
if ! wifiDelIface; then
echo "Can't delete current wifi setup"
exit 1
fi
@ -181,7 +181,7 @@ if [ -s "$hoodfile" ]; then
uci -q set "system.@system[0].hood=$hood"
uci -q commit system
if ! wifiDelAll; then
if ! wifiDelIface; then
echo "Can't delete current wifi setup"
exit 1
fi

View File

@ -14,6 +14,21 @@ wifiDelAll() {
return 0
}
wifiDelIface() {
if [ $# -ne "0" ]
then
echo "Usage: wifiDelIface"
return 1
fi
grep 'config wifi-iface' /etc/config/wireless | sed -n -e "s/.*'\([^']*\)'.*/\1/p" | while read -r line ; do
uci -q delete "wireless.$line"
done
uci -q commit wireless
return 0
}
wifiAddPhy() {
if [ $# -ne "2" ]
then