diff options
author | egon_ffj <egon@freifunk-jena.de> | 2012-04-03 08:19:16 (GMT) |
---|---|---|
committer | egon_ffj <egon@freifunk-jena.de> | 2012-04-03 08:19:16 (GMT) |
commit | cb325e4a9c3efab9155a8420e4c583c541c326c8 (patch) | |
tree | 1adaaebb0461891af213fcddec7ee523ddb5e1bf /files/common/www/service/cgi-bin/cfg_router.json | |
parent | e3416a9c5bbe53907523c03cfb210b3226fe9898 (diff) | |
parent | ed72d266b3bf9ad6332ce56dfb304a6507b0f2c9 (diff) |
Merge branch 'plugnpray' of git://git.freifunk-jena.de/freifunk/ffj-buildroot-v2 into plugnpray
Diffstat (limited to 'files/common/www/service/cgi-bin/cfg_router.json')
-rwxr-xr-x | files/common/www/service/cgi-bin/cfg_router.json | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/files/common/www/service/cgi-bin/cfg_router.json b/files/common/www/service/cgi-bin/cfg_router.json new file mode 100755 index 0000000..3315cc3 --- /dev/null +++ b/files/common/www/service/cgi-bin/cfg_router.json @@ -0,0 +1,33 @@ +#!/bin/sh -e + +. /www/service/cgi-bin/common.sh +check_node_auth + +# parse changes +if [ $REQUEST_METHOD == POST ]; then + . /www/service/cgi-bin/cfg_router.commit +fi + +# compute geo mode value (if not changed during this request) +if [ -z "$router_geo" ]; then + if [ "$(uci get system.position.public)" == 'false' ]; then + router_geo=private + elif [ "$(uci get system.position.automatic)" == 'false' ]; then + router_geo=manual + else + router_geo=automatic + fi +fi + +echo -e "Status: 200 OK\r +Content-Type: application/json\r +\r +{\"router_name\": \"${router_name-$( uci get system.@system[0].hostname)}\", + \"router_password\": \"${router_password-$( uci get system.mesh.webif_password)}\", + \"router_qos\": [${router_qos-$( uci get system.mesh.qos)}], + \"router_vpn\": [${router_vpn-$( uci get system.mesh.vpn)}], + \"router_filter_wan\": [${router_filter_wan-$(uci get system.mesh.filter_wan)}], + \"router_geo\": [\"$router_geo\"] +}" + +exec_lazy
\ No newline at end of file |