Merge pull request #46 from lcb01a/master

Fixed bug which led to empty ath9k-workaround crontab file
This commit is contained in:
Nils Schneider 2014-07-20 18:29:44 +02:00
commit a3ee6eef28
1 changed files with 6 additions and 4 deletions

View File

@ -5,8 +5,10 @@ local uci = require 'luci.model.uci'
local c = uci.cursor()
local f = io.open('/lib/gluon/cron/ath9k-workaround','w')
if f and site.monitor ~= nil then
f:write('* * * * * /usr/sbin/ath9k-workaround | nc ' .. site.monitor)
f:close()
if site.monitor ~= nil then
local f = io.open('/lib/gluon/cron/ath9k-workaround','w')
if f ~= nil then
f:write('* * * * * /usr/sbin/ath9k-workaround | nc ' .. site.monitor)
f:close()
end
end