From 53b75d4562ba0bad3e42688ef02fe3d88f05b104 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 16 Mar 2016 11:08:16 +0100 Subject: [PATCH] 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 --- .../luasrc/model/cbi/admin_system/crontab.lua | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.30.2