[PATCH v11 6/6] fff-config/fff-hoods: Provide a setting to use custom SSIDs
Tim Niemeyer
tim at tn-x.org
Do Nov 2 22:31:21 CET 2017
Hi
Nein, da bin ich gegen. Die SSID gehört zur Hood.
Tim
Am Mittwoch, den 18.10.2017, 23:30 +0200 schrieb Adrian Schmutzler:
> This provides a possibility to set a custom ID for the AP and
> Mesh WiFi interfaces. The patch includes a script to set/reset
> those correctly.
>
> With this, a user can e.g. use an SSID minikaff.freifunk where
> he would otherwise be forced to use remotecity.freifunk, but
> without having to set up his own gateway.
>
> Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
>
> Tested-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> ---
> .../fff/fff-hoods/files/usr/sbin/configurehood | 6 ++++++
> .../fff/fff-support/files/usr/sbin/setwifiids.sh | 18 ++++++++++++++++++
> 2 files changed, 24 insertions(+)
> create mode 100755 src/packages/fff/fff-support/files/usr/sbin/setwifiids.sh
>
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index e7a6eda..01b8056 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -148,6 +148,12 @@ if [ -s /tmp/keyxchangev2data ]; then
> uci -q set "system. at system[0].hood=$hood"
> uci -q commit system
>
> + # Use custom ids if provided
> + customap="$(uci -q get fff.wifi.essid)"
> + custommesh="$(uci -q get fff.wifi.mesh_id)"
> + [ -n "$customap" ] && essid="$customap"
> + [ -n "$custommesh" ] && mesh_id="$custommesh"
> +
> if ! wifiDelAll; then
> echo "Can't delete current wifi setup"
> exit 1
> diff --git a/src/packages/fff/fff-support/files/usr/sbin/setwifiids.sh b/src/packages/fff/fff-support/files/usr/sbin/setwifiids.sh
> new file mode 100755
> index 0000000..dcb7667
> --- /dev/null
> +++ b/src/packages/fff/fff-support/files/usr/sbin/setwifiids.sh
> @@ -0,0 +1,18 @@
> +#!/bin/sh
> +# This sets a custom essid for AP (1st arg) and Mesh (2nd arg),
> +# resetting each to standard if not provided (no args=full reset)
> +#
> +# Supports only 802.11s mesh ID (no AdHoc)
> +
> +essid=$1
> +mesh_id=$2
> +
> +uci -q set "fff.wifi=fff"
> +uci -q delete "fff.wifi.essid"
> +uci -q delete "fff.wifi.mesh_id"
> +
> +[ -n "$essid" ] && uci -q set "fff.wifi.essid=$essid"
> +[ -n "$mesh_id" ] && uci -q set "fff.wifi.mesh_id=$mesh_id"
> +uci -q commit fff
> +
> +rm -f /www/public/keyxchangev2data # delete this, so settings will be applied during next run of configurehood
> --
> 2.7.4
>
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname : signature.asc
Dateityp : application/pgp-signature
Dateigröße : 473 bytes
Beschreibung: This is a digitally signed message part
URL : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20171102/44463543/attachment.sig>
Mehr Informationen über die Mailingliste franken-dev