From patchwork Mon Oct 3 16:21:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [RFC] Add Hoodselection in WebUI From: Christian Dresel X-Patchwork-Id: 229 Message-Id: <1475511686-14607-1-git-send-email-fff@chrisi01.de> To: franken-dev@freifunk.net Date: Mon, 3 Oct 2016 18:21:26 +0200 Dieses Patch bietet die Möglichkeit im WebUI eine Hood auszuählen. Vorgesehen ist dies nur für lokale Hoods mit Gateway vor Ort. AKtuell sind die Hooddaten noch fest im Patch integriert, später sollten sie aus den Hoodfiles des dez. Keyxchange kommen. Bitte dieses Patch daher noch nicht applien, es dient nur als Information das es sowas mittlerweile gibt. Signed-off-by: Christian Dresel --- .../fff/fff-web/files/www/ssl/cgi-bin/header | 1 + .../fff/fff-web/files/www/ssl/cgi-bin/hood.html | 103 +++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 src/packages/fff/fff-web/files/www/ssl/cgi-bin/hood.html diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header index 4cecfcd..7a7d905 100755 --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header @@ -36,6 +36,7 @@ HOSTNAME=$(uci get -q 'system.@system[0].hostname') nav_entry settings.html "Einstellungen" nav_entry ports.html "Anschlüsse" nav_entry wifiscan.html "Wifi Scan" + nav_entry hood.html "Hoodauswahl" nav_entry upgrade.html "Upgrade" nav_entry password.html "Password" nav_entry reboot.html "Neustart" diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/hood.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/hood.html new file mode 100644 index 0000000..aa3f211 --- /dev/null +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/hood.html @@ -0,0 +1,103 @@ +#!/usr/bin/haserl + +<% +if [ "$REQUEST_METHOD" == "POST" ] ; then + + hood=${POST_hood} + uci set -q "system.@system[0].hood=${POST_hood}" + uci commit + + if [ $hood == "legacy" ] ; then + ( + echo "BATMAN_CHANNEL=1" + echo "BATMAN_CHANNEL_5GHZ=36" + echo "ESSID_AP=franken.freifunk.net" + echo "ESSID_MESH=batman.franken.freifunk.net" + echo "BSSID_MESH=00:ca:ff:ee:ba:be" + echo "VPN_PROJECT=fff" + echo "NTPD_IP=fe80::ff:feee:1%br-mesh" + echo "UPGRADE_PATH=http://[fe80::ff:feee:1%br-mesh]/dev/firmware/current" + ) > /etc/community.cfg + fi + + if [ $hood == "fablabnbg" ] ; then + ( + echo "BATMAN_CHANNEL=1" + echo "BATMAN_CHANNEL_5GHZ=36" + echo "ESSID_AP=fablabnbg.freifunk.net" + echo "ESSID_MESH=batman.fablabnbg.freifunk.net" + echo "BSSID_MESH=ca:ff:ee:ba:be:04" + echo "VPN_PROJECT=fff" + echo "NTPD_IP=fe80::ff:feee:1%br-mesh" + echo "UPGRADE_PATH=http://[fe80::ff:feee:1%br-mesh]/dev/firmware/current" + ) > /etc/community.cfg + fi + + if [ $hood == "db0fue" ] ; then + ( + echo "BATMAN_CHANNEL=1" + echo "BATMAN_CHANNEL_5GHZ=36" + echo "ESSID_AP=db0fue.freifunk.net" + echo "ESSID_MESH=batman.db0fue.freifunk.net" + echo "BSSID_MESH=ca:ff:ee:ba:be:05" + echo "VPN_PROJECT=fff" + echo "NTPD_IP=fe80::ff:feee:1%br-mesh" + echo "UPGRADE_PATH=http://[fe80::ff:feee:1%br-mesh]/dev/firmware/current" + ) > /etc/community.cfg + fi + + if [ $hood == "ufb" ] ; then + ( + echo "BATMAN_CHANNEL=1" + echo "BATMAN_CHANNEL_5GHZ=36" + echo "ESSID_AP=ufb.freifunk.net" + echo "ESSID_MESH=batman.ufb.freifunk.net" + echo "BSSID_MESH=ca:ff:ee:ba:be:06" + echo "VPN_PROJECT=fff" + echo "NTPD_IP=fe80::ff:feee:1%br-mesh" + echo "UPGRADE_PATH=http://[fe80::ff:feee:1%br-mesh]/dev/firmware/current" + ) > /etc/community.cfg + fi + cp /rom/etc/uci-defaults/60-fff-wireless /etc/uci-defaults/ + do_reboot=1 + +fi +%> +<%in /www/ssl/cgi-bin/header %> +<%in /www/ssl/cgi-bin/helpers %> +<% show_msg %> +
+ + + +
+
+ Hoodauswahl + + + + + +
Ausgewählte Hood:<% uci get -q "system.@system[0].hood" %>
Hood: + +
Wähle hier nur eine Hood aus, die auch per Kabel oder WLAN erreichbar ist. Der Router kann keine VPN Verbindung aufbauen, er ist nur als Meshrouter zu verwenden! +
+ + +
+
+ +
+<%in /www/ssl/cgi-bin/footer %> +<% +# write +if [ "$do_reboot" == "1" ] ; then + reboot +fi +%> +