summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_delete.lua
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2017-07-19 22:36:47 +0200
committerDirk Brenken <dev@brenken.org>2017-07-20 07:44:15 +0200
commite900b892e871fcd0939df883e9586febe665c252 (patch)
tree50109c8e420961c8a019b6fc6702a63dd9b1e251 /applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_delete.lua
parent76b3af64c038905ddcc1c511b99c65e3c4879bbc (diff)
luci-app-travelmate: sync with travelmate 0.9.0
* add a wireless station manager to edit and delete existing interfaces or scan for new uplinks Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_delete.lua')
-rw-r--r--applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_delete.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_delete.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_delete.lua
new file mode 100644
index 000000000..97ec1ca3c
--- /dev/null
+++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_delete.lua
@@ -0,0 +1,14 @@
+-- Copyright 2017 Dirk Brenken (dev@brenken.org)
+-- This is free software, licensed under the Apache License, Version 2.0
+
+local uci = require("luci.model.uci").cursor()
+local http = require("luci.http")
+local cfg = http.formvalue("cfg")
+
+if cfg ~= nil then
+ uci:delete("wireless", cfg)
+ uci:save("wireless")
+ uci:commit("wireless")
+end
+
+http.redirect(luci.dispatcher.build_url("admin/services/travelmate/stations"))