Merge pull request #36 from freifunk-gluon/gluon-announce
gluon-announce: detach announce.d from alfred
This commit is contained in:
commit
0312167fcd
@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/package.mk
|
|||||||
define Package/gluon-alfred
|
define Package/gluon-alfred
|
||||||
SECTION:=gluon
|
SECTION:=gluon
|
||||||
CATEGORY:=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
|
TITLE:=Configure alfred
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
* * * * * /lib/gluon/alfred/announce.lua
|
* * * * * /lib/gluon/announce/announce.lua | gzip | alfred -s 158
|
||||||
|
32
package/gluon-announce/Makefile
Normal file
32
package/gluon-announce/Makefile
Normal 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))
|
@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/lua
|
#!/usr/bin/lua
|
||||||
|
|
||||||
local alfred_data_type = 158
|
local announce_dir = '/lib/gluon/announce/announce.d'
|
||||||
local announce_dir = '/lib/gluon/alfred/announce.d'
|
|
||||||
|
|
||||||
|
|
||||||
fs = require 'luci.fs'
|
fs = require 'luci.fs'
|
||||||
@ -40,5 +39,4 @@ end
|
|||||||
|
|
||||||
|
|
||||||
encoder = json.Encoder(collect_dir(announce_dir))
|
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(io.stdout))
|
||||||
ltn12.pump.all(encoder:source(), ltn12.sink.file(alfred))
|
|
Loading…
Reference in New Issue
Block a user