diff --git a/package/gluon-alfred/files/lib/gluon/cron/alfred b/package/gluon-alfred/files/lib/gluon/cron/alfred index 2d931625..72f219a8 100644 --- a/package/gluon-alfred/files/lib/gluon/cron/alfred +++ b/package/gluon-alfred/files/lib/gluon/cron/alfred @@ -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 diff --git a/package/gluon-announce/files/lib/gluon/announce/announce.lua b/package/gluon-announce/files/lib/gluon/announce/announce.lua index e51445f7..7bce0a78 100755 --- a/package/gluon-announce/files/lib/gluon/announce/announce.lua +++ b/package/gluon-announce/files/lib/gluon/announce/announce.lua @@ -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)) diff --git a/package/gluon-announce/files/lib/gluon/announce/announce.d/hardware/model b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/model similarity index 100% rename from package/gluon-announce/files/lib/gluon/announce/announce.d/hardware/model rename to package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/model diff --git a/package/gluon-announce/files/lib/gluon/announce/announce.d/hostname b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hostname similarity index 100% rename from package/gluon-announce/files/lib/gluon/announce/announce.d/hostname rename to package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hostname diff --git a/package/gluon-announce/files/lib/gluon/announce/announce.d/network/mac b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/network/mac similarity index 100% rename from package/gluon-announce/files/lib/gluon/announce/announce.d/network/mac rename to package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/network/mac diff --git a/package/gluon-announce/files/lib/gluon/announce/announce.d/node_id b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/node_id similarity index 100% rename from package/gluon-announce/files/lib/gluon/announce/announce.d/node_id rename to package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/node_id diff --git a/package/gluon-announce/files/lib/gluon/announce/announce.d/software/firmware b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware similarity index 100% rename from package/gluon-announce/files/lib/gluon/announce/announce.d/software/firmware rename to package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware diff --git a/package/gluon-announce/files/lib/gluon/announce/announce.d/statistics/idletime b/package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime similarity index 100% rename from package/gluon-announce/files/lib/gluon/announce/announce.d/statistics/idletime rename to package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime diff --git a/package/gluon-announce/files/lib/gluon/announce/announce.d/statistics/loadavg b/package/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg similarity index 100% rename from package/gluon-announce/files/lib/gluon/announce/announce.d/statistics/loadavg rename to package/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg diff --git a/package/gluon-announce/files/lib/gluon/announce/announce.d/statistics/memory b/package/gluon-announce/files/lib/gluon/announce/statistics.d/memory similarity index 100% rename from package/gluon-announce/files/lib/gluon/announce/announce.d/statistics/memory rename to package/gluon-announce/files/lib/gluon/announce/statistics.d/memory diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/node_id b/package/gluon-announce/files/lib/gluon/announce/statistics.d/node_id new file mode 100644 index 00000000..7ff75b2d --- /dev/null +++ b/package/gluon-announce/files/lib/gluon/announce/statistics.d/node_id @@ -0,0 +1 @@ +return require('gluon.sysconfig').primary_mac:gsub(':', '') diff --git a/package/gluon-announce/files/lib/gluon/announce/announce.d/statistics/processes b/package/gluon-announce/files/lib/gluon/announce/statistics.d/processes similarity index 100% rename from package/gluon-announce/files/lib/gluon/announce/announce.d/statistics/processes rename to package/gluon-announce/files/lib/gluon/announce/statistics.d/processes diff --git a/package/gluon-announce/files/lib/gluon/announce/announce.d/statistics/uptime b/package/gluon-announce/files/lib/gluon/announce/statistics.d/uptime similarity index 100% rename from package/gluon-announce/files/lib/gluon/announce/announce.d/statistics/uptime rename to package/gluon-announce/files/lib/gluon/announce/statistics.d/uptime diff --git a/package/gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced b/package/gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced index b5546ff0..4fb154f1 100644 --- a/package/gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced +++ b/package/gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced @@ -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 diff --git a/package/gluon-ath9k-workaround/files/lib/gluon/announce/announce.d/network/ath9k_workaround_trigger b/package/gluon-ath9k-workaround/files/lib/gluon/announce/statistics.d/network/ath9k_workaround_trigger similarity index 100% rename from package/gluon-ath9k-workaround/files/lib/gluon/announce/announce.d/network/ath9k_workaround_trigger rename to package/gluon-ath9k-workaround/files/lib/gluon/announce/statistics.d/network/ath9k_workaround_trigger diff --git a/package/gluon-autoupdater/files/lib/gluon/announce/announce.d/software/autoupdater b/package/gluon-autoupdater/files/lib/gluon/announce/nodeinfo.d/software/autoupdater similarity index 100% rename from package/gluon-autoupdater/files/lib/gluon/announce/announce.d/software/autoupdater rename to package/gluon-autoupdater/files/lib/gluon/announce/nodeinfo.d/software/autoupdater diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/network/addresses b/package/gluon-mesh-batman-adv/files/lib/gluon/announce/nodeinfo.d/network/addresses similarity index 100% rename from package/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/network/addresses rename to package/gluon-mesh-batman-adv/files/lib/gluon/announce/nodeinfo.d/network/addresses diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/network/mesh_interfaces b/package/gluon-mesh-batman-adv/files/lib/gluon/announce/nodeinfo.d/network/mesh_interfaces similarity index 100% rename from package/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/network/mesh_interfaces rename to package/gluon-mesh-batman-adv/files/lib/gluon/announce/nodeinfo.d/network/mesh_interfaces diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/software/batman-adv b/package/gluon-mesh-batman-adv/files/lib/gluon/announce/nodeinfo.d/software/batman-adv similarity index 100% rename from package/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/software/batman-adv rename to package/gluon-mesh-batman-adv/files/lib/gluon/announce/nodeinfo.d/software/batman-adv diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/network/gateway b/package/gluon-mesh-batman-adv/files/lib/gluon/announce/statistics.d/gateway similarity index 100% rename from package/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/network/gateway rename to package/gluon-mesh-batman-adv/files/lib/gluon/announce/statistics.d/gateway diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/statistics/traffic b/package/gluon-mesh-batman-adv/files/lib/gluon/announce/statistics.d/traffic similarity index 100% rename from package/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/statistics/traffic rename to package/gluon-mesh-batman-adv/files/lib/gluon/announce/statistics.d/traffic diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/announce.d/software/fastd b/package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/nodeinfo.d/software/fastd similarity index 100% rename from package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/announce.d/software/fastd rename to package/gluon-mesh-vpn-fastd/files/lib/gluon/announce/nodeinfo.d/software/fastd diff --git a/package/gluon-node-info/files/lib/gluon/announce/announce.d/location b/package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/location similarity index 100% rename from package/gluon-node-info/files/lib/gluon/announce/announce.d/location rename to package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/location diff --git a/package/gluon-node-info/files/lib/gluon/announce/announce.d/owner b/package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/owner similarity index 100% rename from package/gluon-node-info/files/lib/gluon/announce/announce.d/owner rename to package/gluon-node-info/files/lib/gluon/announce/nodeinfo.d/owner