kplex: add init script
authorNuno Goncalves <redacted>
Sun, 9 Aug 2015 10:50:11 +0000 (11:50 +0100)
committerNuno Goncalves <redacted>
Sun, 9 Aug 2015 10:50:11 +0000 (11:50 +0100)
Signed-off-by: Nuno Goncalves <redacted>
net/kplex/Makefile
net/kplex/files/kplex.init [new file with mode: 0644]

index fc7dc2c47bbd769f77e404f055e637b5bd08510a..5fac1fa2daade5f5f5c5ad3114bdb58d6427348d 100644 (file)
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=kplex
-PKG_VERSION:=20150728
+PKG_VERSION:=20150809
 
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
@@ -38,10 +38,15 @@ define Package/kplex/description
   Pseudo Terminals (ptys), Network Interfaces and Files.
 endef
 
+define Package/kplex/conffiles
+/etc/kplex.conf
+endef
 
 define Package/kplex/install
        $(INSTALL_DIR) $(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
 
 $(eval $(call BuildPackage,kplex))
diff --git a/net/kplex/files/kplex.init b/net/kplex/files/kplex.init
new file mode 100644 (file)
index 0000000..8e48041
--- /dev/null
@@ -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
+}
git clone https://git.99rst.org/PROJECT