Skip to content
Snippets Groups Projects
Commit 0a3bf70d authored by Nils Schneider's avatar Nils Schneider
Browse files

split announce.d into nodeinfo + statistics

parent a9c22c5a
No related branches found
No related tags found
No related merge requests found
Showing
with 6 additions and 3 deletions
* * * * * /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
#!/usr/bin/lua #!/usr/bin/lua
local announce_dir = '/lib/gluon/announce/announce.d' local announce_base = '/lib/gluon/announce/'
fs = require 'luci.fs' fs = require 'luci.fs'
...@@ -37,6 +37,7 @@ function collect_dir(dir) ...@@ -37,6 +37,7 @@ function collect_dir(dir)
return ret return ret
end end
local announce_dir = announce_base .. arg[1] .. '.d/'
encoder = json.Encoder(collect_dir(announce_dir)) encoder = json.Encoder(collect_dir(announce_dir))
ltn12.pump.all(encoder:source(), ltn12.sink.file(io.stdout)) ltn12.pump.all(encoder:source(), ltn12.sink.file(io.stdout))
return require('gluon.sysconfig').primary_mac:gsub(':', '')
...@@ -21,7 +21,7 @@ restart_announced () { ...@@ -21,7 +21,7 @@ restart_announced () {
DEVS=$(cat $DEVLIST | while read dev iface;do echo -n " -i $dev";done) DEVS=$(cat $DEVLIST | while read dev iface;do echo -n " -i $dev";done)
service_stop $DAEMON 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 case "$ACTION" in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment