X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-mod-admin-full%2Fluasrc%2Fmodel%2Fcbi%2Fadmin_system%2Fcrontab.lua;h=016a6199aab56c6b0a5e10d06e5963f148f44013;hp=8d3f49837cf584e713899dbc2b65fe3a66fe1bfb;hb=4f04e6126ecae11df3cc0e71a4ae74f1cb1543fe;hpb=7a3493b1f7d75a3945279115324cf2ff4da26b7b 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 8d3f49837..016a6199a 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 @@ -1,11 +1,14 @@ -- Copyright 2008 Steven Barth --- Copyright 2008-2013 Jo-Philipp Wich +-- Copyright 2008-2013 Jo-Philipp Wich -- Licensed to the public under the Apache License 2.0. local fs = require "nixio.fs" local cronfile = "/etc/crontabs/root" -f = SimpleForm("crontab", translate("Scheduled Tasks"), translate("This is the system crontab in which scheduled tasks can be defined.")) +f = SimpleForm("crontab", translate("Scheduled Tasks"), + translate("This is the system crontab in which scheduled tasks can be defined.") .. + translate("
Note: you need to manually restart the cron service if the " .. + "crontab file was empty before editing.")) t = f:field(TextValue, "crons") t.rmempty = true @@ -19,6 +22,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