split announce.d into nodeinfo + statistics

This commit is contained in:
Nils Schneider 2014-07-19 12:35:32 +02:00
parent a9c22c5ace
commit 0a3bf70d56
24 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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))

View File

@ -0,0 +1 @@
return require('gluon.sysconfig').primary_mac:gsub(':', '')

View File

@ -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