luci-mod-admin-full: allow writing empty crontab config
authorFlorian Eckert <Eckert.Florian@googlemail.com>
Wed, 16 Mar 2016 10:08:16 +0000 (11:08 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 17 Mar 2016 15:30:25 +0000 (16:30 +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 bef9651ea1ca54c74127600501d1f616fac9f70a..ea92eb98de6c1a0a8b667273a3f94339dca0a41f 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