9b19883d97
Allows reconfigurtion of remote syslog from within site.conf. Conflicts with the gluon-web-logging package as user made changes will be overwritten, because this package will reconfigure the syslog destination on every upgrade. Resolves #1845
20 lines
598 B
Lua
Executable File
20 lines
598 B
Lua
Executable File
#!/usr/bin/lua
|
|
local site = require('gluon.site')
|
|
local uci = require('simple-uci').cursor()
|
|
|
|
local system = uci:get_first('system', 'system')
|
|
|
|
if not site.syslog.ip() then
|
|
uci:delete('system', system, 'log_remote')
|
|
uci:delete('system', system, 'log_ip')
|
|
uci:delete('system', system, 'log_port')
|
|
uci:delete('system', system, 'log_proto')
|
|
else
|
|
uci:set('system', system, 'log_remote', 1)
|
|
uci:set('system', system, 'log_ip', site.syslog.ip())
|
|
uci:set('system', system, 'log_port', site.syslog.port(514))
|
|
uci:set('system', system, 'log_proto', site.syslog.proto('udp'))
|
|
end
|
|
|
|
uci:save('system')
|