Kaynağa Gözat

kplex: add init script

Signed-off-by: Nuno Goncalves <nunojpg@gmail.com>
Nuno Goncalves 9 yıl önce
ebeveyn
işleme
f5e6c1120b
2 değiştirilmiş dosya ile 25 ekleme ve 1 silme
  1. 6
    1
      net/kplex/Makefile
  2. 19
    0
      net/kplex/files/kplex.init

+ 6
- 1
net/kplex/Makefile Dosyayı Görüntüle

@@ -7,7 +7,7 @@
7 7
 include $(TOPDIR)/rules.mk
8 8
 
9 9
 PKG_NAME:=kplex
10
-PKG_VERSION:=20150728
10
+PKG_VERSION:=20150809
11 11
 
12 12
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
13 13
 
@@ -38,10 +38,15 @@ define Package/kplex/description
38 38
   Pseudo Terminals (ptys), Network Interfaces and Files.
39 39
 endef
40 40
 
41
+define Package/kplex/conffiles
42
+/etc/kplex.conf
43
+endef
41 44
 
42 45
 define Package/kplex/install
43 46
 	$(INSTALL_DIR) $(1)/usr/bin
44 47
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/kplex $(1)/usr/bin/
48
+	$(INSTALL_DIR) $(1)/etc/init.d
49
+	$(INSTALL_BIN) ./files/kplex.init $(1)/etc/init.d/kplex
45 50
 endef
46 51
 
47 52
 $(eval $(call BuildPackage,kplex))

+ 19
- 0
net/kplex/files/kplex.init Dosyayı Görüntüle

@@ -0,0 +1,19 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2015 OpenWrt.org
3
+
4
+START=99
5
+
6
+USE_PROCD=1
7
+PROG=/usr/bin/kplex
8
+
9
+CONF_FILE=/etc/kplex.conf
10
+
11
+start_service() {
12
+	[ -e "$CONF_FILE" ] || return 1
13
+	
14
+	procd_open_instance
15
+	procd_set_param command "$PROG" -f "$CONF_FILE"
16
+	procd_set_param respawn	
17
+	procd_set_param file "$CONF_FILE"
18
+	procd_close_instance
19
+}