split announce.d into nodeinfo + statistics
This commit is contained in:
parent
a9c22c5ace
commit
0a3bf70d56
@ -1 +1,2 @@
|
||||
* * * * * /lib/gluon/announce/announce.lua | gzip | alfred -s 158
|
||||
* * * * * /lib/gluon/announce/announce.lua nodeinfo | gzip | alfred -s 158
|
||||
* * * * * /lib/gluon/announce/announce.lua statistics | gzip | alfred -s 159
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/lua
|
||||
|
||||
local announce_dir = '/lib/gluon/announce/announce.d'
|
||||
local announce_base = '/lib/gluon/announce/'
|
||||
|
||||
|
||||
fs = require 'luci.fs'
|
||||
@ -37,6 +37,7 @@ function collect_dir(dir)
|
||||
return ret
|
||||
end
|
||||
|
||||
local announce_dir = announce_base .. arg[1] .. '.d/'
|
||||
|
||||
encoder = json.Encoder(collect_dir(announce_dir))
|
||||
ltn12.pump.all(encoder:source(), ltn12.sink.file(io.stdout))
|
||||
|
@ -0,0 +1 @@
|
||||
return require('gluon.sysconfig').primary_mac:gsub(':', '')
|
@ -21,7 +21,7 @@ restart_announced () {
|
||||
DEVS=$(cat $DEVLIST | while read dev iface;do echo -n " -i $dev";done)
|
||||
|
||||
service_stop $DAEMON
|
||||
service_start $DAEMON -g ff02:0:0:0:0:0:2:1001 -p 1001 -s /lib/gluon/announce/announce.lua $DEVS
|
||||
service_start $DAEMON -g ff02:0:0:0:0:0:2:1001 -p 1001 -s '/lib/gluon/announce/announce.lua nodeinfo' $DEVS
|
||||
}
|
||||
|
||||
case "$ACTION" in
|
||||
|
Loading…
Reference in New Issue
Block a user