summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorFlorian Eckert <Eckert.Florian@googlemail.com>2016-03-16 11:08:16 +0100
committerJo-Philipp Wich <jow@openwrt.org>2016-03-17 16:30:25 +0100
commit175ae35d87857159ba19bdc3bf8c667d9438c79d (patch)
treefc4bf2b2f50f08884729e6c8ad684c31f47d19b9 /modules
parent362db10f882fc448f550e1f0de1afeb27ab3156f (diff)
luci-mod-admin-full: allow writing empty crontab config
Write an empty crontab file to remove all content from file /etc/crontabs/root Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/crontab.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/crontab.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/crontab.lua
index bef9651ea..ea92eb98d 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/crontab.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/crontab.lua
@@ -19,6 +19,8 @@ function f.handle(self, state, data)
if data.crons then
fs.writefile(cronfile, data.crons:gsub("\r\n", "\n"))
luci.sys.call("/usr/bin/crontab %q" % cronfile)
+ else
+ fs.writefile(cronfile, "")
end
end
return true