Fixed bug which led to empty ath9k crontab file
The crontab file was opened in write mode but in the case where no monitor is defined it would leave an empty file.
This commit is contained in:
parent
b469347770
commit
ef40aa28e8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue