From 175ae35d87857159ba19bdc3bf8c667d9438c79d Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 16 Mar 2016 11:08:16 +0100 Subject: 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 --- modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/crontab.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/luci-mod-admin-full/luasrc/model/cbi/admin_system') 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 bef9651ea1..ea92eb98de 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 -- cgit v1.2.3