gluon-announce: detach announce.d from alfred
All announce.d scripts have been moved to /lib/gluon/announce/announce.d The script /lib/gluon/announce/announce.lua will collect all information and output json.
This commit is contained in:
parent
7773afdc18
commit
318e9d1a1d
@ -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