Merge pull request #36 from freifunk-gluon/gluon-announce

gluon-announce: detach announce.d from alfred
This commit is contained in:
NeoRaider 2014-07-11 14:45:40 +02:00
commit 0312167fcd
21 changed files with 36 additions and 6 deletions

View File

@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/gluon-alfred
SECTION:=gluon
CATEGORY:=Gluon
DEPENDS:=+gluon-core +gluon-cron +alfred +ethtool +luci-lib-json +luci-lib-core
DEPENDS:=+gluon-core +gluon-announce +gluon-cron +alfred
TITLE:=Configure alfred
endef

View File

@ -1 +1 @@
* * * * * /lib/gluon/alfred/announce.lua
* * * * * /lib/gluon/announce/announce.lua | gzip | alfred -s 158

View File

@ -0,0 +1,32 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-announce
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/gluon-announce
SECTION:=gluon
CATEGORY:=Gluon
DEPENDS:=+gluon-core +luci-lib-json +ethtool
TITLE:=Lua scripts announcing various information
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/gluon-announce/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,gluon-announce))

View File

@ -1,7 +1,6 @@
#!/usr/bin/lua
local alfred_data_type = 158
local announce_dir = '/lib/gluon/alfred/announce.d'
local announce_dir = '/lib/gluon/announce/announce.d'
fs = require 'luci.fs'
@ -40,5 +39,4 @@ end
encoder = json.Encoder(collect_dir(announce_dir))
alfred = io.popen('gzip | alfred -s ' .. tostring(alfred_data_type), 'w')
ltn12.pump.all(encoder:source(), ltn12.sink.file(alfred))
ltn12.pump.all(encoder:source(), ltn12.sink.file(io.stdout))