forked from freifunk-franken/firmware
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:
parent
46d8b9b8b2
commit
72942057bc
|
@ -81,7 +81,7 @@ else
|
||||||
rm -f "$sectorcopy" # always delete: no broadcast for isolated device
|
rm -f "$sectorcopy" # always delete: no broadcast for isolated device
|
||||||
rm -f "$sectortmp"
|
rm -f "$sectortmp"
|
||||||
|
|
||||||
if ! wifiDelAll; then
|
if ! wifiDelIface; then
|
||||||
echo "Can't delete current wifi setup"
|
echo "Can't delete current wifi setup"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -181,7 +181,7 @@ if [ -s "$hoodfile" ]; then
|
||||||
uci -q set "system.@system[0].hood=$hood"
|
uci -q set "system.@system[0].hood=$hood"
|
||||||
uci -q commit system
|
uci -q commit system
|
||||||
|
|
||||||
if ! wifiDelAll; then
|
if ! wifiDelIface; then
|
||||||
echo "Can't delete current wifi setup"
|
echo "Can't delete current wifi setup"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -14,6 +14,21 @@ wifiDelAll() {
|
||||||
return 0
|
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() {
|
wifiAddPhy() {
|
||||||
if [ $# -ne "2" ]
|
if [ $# -ne "2" ]
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user