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 <Eckert.Florian@googlemail.com>
This commit is contained in:
Florian Eckert 2016-03-16 11:08:16 +01:00
parent f1190e2d07
commit 53b75d4562

View 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