mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 21:24:31 +04:00
kplex: add init script
Signed-off-by: Nuno Goncalves <nunojpg@gmail.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=kplex
|
PKG_NAME:=kplex
|
||||||
PKG_VERSION:=20150728
|
PKG_VERSION:=20150809
|
||||||
|
|
||||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||||
|
|
||||||
@@ -38,10 +38,15 @@ define Package/kplex/description
|
|||||||
Pseudo Terminals (ptys), Network Interfaces and Files.
|
Pseudo Terminals (ptys), Network Interfaces and Files.
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/kplex/conffiles
|
||||||
|
/etc/kplex.conf
|
||||||
|
endef
|
||||||
|
|
||||||
define Package/kplex/install
|
define Package/kplex/install
|
||||||
$(INSTALL_DIR) $(1)/usr/bin
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/kplex $(1)/usr/bin/
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/kplex $(1)/usr/bin/
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) ./files/kplex.init $(1)/etc/init.d/kplex
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,kplex))
|
$(eval $(call BuildPackage,kplex))
|
||||||
|
|||||||
19
net/kplex/files/kplex.init
Normal file
19
net/kplex/files/kplex.init
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
# Copyright (C) 2015 OpenWrt.org
|
||||||
|
|
||||||
|
START=99
|
||||||
|
|
||||||
|
USE_PROCD=1
|
||||||
|
PROG=/usr/bin/kplex
|
||||||
|
|
||||||
|
CONF_FILE=/etc/kplex.conf
|
||||||
|
|
||||||
|
start_service() {
|
||||||
|
[ -e "$CONF_FILE" ] || return 1
|
||||||
|
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command "$PROG" -f "$CONF_FILE"
|
||||||
|
procd_set_param respawn
|
||||||
|
procd_set_param file "$CONF_FILE"
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user