luci-mod-admin-full: allow writing empty crontab config 674/head
authorFlorian Eckert <Eckert.Florian@googlemail.com>
Wed, 16 Mar 2016 10:08:16 +0000 (11:08 +0100)
committerFlorian Eckert <Eckert.Florian@googlemail.com>
Wed, 16 Mar 2016 10:08:16 +0000 (11:08 +0100)
Write an empty crontab file to remove all content
from file /etc/crontabs/root

Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com>
modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/crontab.lua

index bef9651..ea92eb9 100644 (file)
@@ -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