summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-admin-full/luasrc
diff options
context:
space:
mode:
authorDaniel Dickinson <openwrt@daniel.thecshore.com>2015-12-02 00:23:04 -0500
committerDaniel Dickinson <openwrt@daniel.thecshore.com>2015-12-02 02:17:20 -0500
commit1d5cab4ced656d71e1913470b8b06e051bd492d3 (patch)
treebc03dfeeee82f90c5dd1fac6ca13ee54df129898 /modules/luci-mod-admin-full/luasrc
parent89f74f77dab023393832a91551aca6e8a02030fb (diff)
luci-mod-admin-full: fstab: Add ability to redo the detection of block devices
Adds a button that does block detect and write the new configuration to /etc/config/fstab.
Diffstat (limited to 'modules/luci-mod-admin-full/luasrc')
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab.lua
index e6f207b2e8..fd466d5c26 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab.lua
@@ -33,12 +33,19 @@ until not ln
block:close()
-
m = Map("fstab", translate("Mount Points"))
s = m:section(TypedSection, "global", translate("Global Settings"))
s.addremove = false
s.anonymous = true
+detect = s:option(Button, "block_detect", translate("Generate Config"), translate("Find all currently attached filesystems and swap and replace configuration with defaults based on what was detected"))
+detect.inputstyle = "reload"
+
+detect.write = function(self, section)
+ luci.sys.call("block detect >/etc/config/fstab")
+ luci.http.redirect(luci.dispatcher.build_url("admin/system", "fstab"))
+end
+
o = s:option(Flag, "anon_swap", translate("Anonymous Swap"), translate("Mount swap not specifically configured"))
o.default = o.disabled
o.rmempty = false