[PATCH] fff-hoods/fff-wireless: Don't delete WiFi devices
Tim Niemeyer
tim at tn-x.org
Sa Nov 4 14:49:49 CET 2017
Hi
Applied.
Tim
Am Donnerstag, den 02.11.2017, 14:31 +0100 schrieb Adrian Schmutzler:
> 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.
>
> Semi-tested: Tested via command-line, but separate from
> configurehood.
>
> Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> ---
> src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 4 ++--
> .../fff/fff-wireless/files/lib/functions/fff/wireless | 15
> +++++++++++++++
> 2 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index 8437c33..b1b674e 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -78,7 +78,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
> @@ -178,7 +178,7 @@ if [ -s "$hoodfile" ]; then
> uci -q set "system. at system[0].hood=$hood"
> uci -q commit system
>
> - if ! wifiDelAll; then
> + if ! wifiDelIface; then
> echo "Can't delete current wifi setup"
> exit 1
> fi
> diff --git a/src/packages/fff/fff-
> wireless/files/lib/functions/fff/wireless b/src/packages/fff/fff-
> wireless/files/lib/functions/fff/wireless
> index b1ff5a9..5b63397 100644
> --- a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless
> +++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless
> @@ -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
> --
> 2.7.4
>
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname : signature.asc
Dateityp : application/pgp-signature
Dateigröße : 488 bytes
Beschreibung: This is a digitally signed message part
URL : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20171104/086c0fe2/attachment.sig>
Mehr Informationen über die Mailingliste franken-dev