module("luci.controller.remount", package.seeall) function index() local page = node("remount") page.sysauth = "root" page.sysauth_authenticator = "htmlauth" entry({"remount"}, template("remount"), "Remount") entry({"remount", "readonly"}, call("readonly")) entry({"remount", "readwrite"}, call("readwrite")) end function readwrite() luci.sys.exec("mount -o remount,rw,noatime /") luci.http.redirect(luci.dispatcher.build_url("remount")) end function readonly() luci.sys.exec("mount -o remount,ro /") luci.http.redirect(luci.dispatcher.build_url("remount")) end function mounted() local data = "" local partitions = luci.util.execi("mount") if not partitions then return "failure with mount command" end for line in partitions do if string.match(line,"^/.+%s/%s.+") then data = data .. line .. "\n" end end return data end