Merge pull request #656 from nlhintz/pull-request
[project/luci.git] / modules / luci-mod-admin-full / luasrc / model / cbi / admin_system / crontab.lua
index 8d3f498..ea92eb9 100644 (file)
@@ -1,5 +1,5 @@
 -- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2008-2013 Jo-Philipp Wich <xm@subsignal.org>
+-- Copyright 2008-2013 Jo-Philipp Wich <jow@openwrt.org>
 -- Licensed to the public under the Apache License 2.0.
 
 local fs = require "nixio.fs"
@@ -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