From: Florian Eckert Date: Wed, 16 Mar 2016 10:08:16 +0000 (+0100) Subject: luci-mod-admin-full: allow writing empty crontab config X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=53b75d4562ba0bad3e42688ef02fe3d88f05b104;p=oweals%2Fluci.git 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 --- 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