Add initscript to yate

Signed-off-by: Robert Högberg <[email protected]>
---
diff --git a/net/yate/Makefile b/net/yate/Makefile
index 4024a29..c62182e 100644
--- a/net/yate/Makefile
+++ b/net/yate/Makefile
@@ -40,6 +40,7 @@ endef
 
 define Package/$(PKG_NAME)/conffiles
 /etc/yate/yate.conf
+/etc/init.d/yate
 endef
 
 define Package/$(PKG_NAME)/Default/description
@@ -120,6 +121,8 @@ define Package/$(PKG_NAME)/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/yate $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/yate/yate.conf    
$(1)/etc/$(PKG_NAME)/yate.conf
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/yate.init $(1)/etc/init.d/yate
 endef
 
 define Package/$(PKG_NAME)-scripts-php/install
diff --git a/net/yate/files/yate.init b/net/yate/files/yate.init
index e69de29..4fe8c58 100644
--- a/net/yate/files/yate.init
+++ b/net/yate/files/yate.init
@@ -0,0 +1,25 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2013 OpenWrt.org
+START=50
+
+SERVICE_USE_PID=1
+
+YATE_BINARY="/usr/bin/yate"
+YATE_LOG_FILE=""
+YATE_OPTIONS="-d -s -p /var/run/yate.pid"
+
+start() {
+       if [ -n "$YATE_LOG_FILE" ]; then
+               YATE_OPTIONS="$YATE_OPTIONS -r -l $YATE_LOG_FILE"
+       fi
+
+       service_start $YATE_BINARY $YATE_OPTIONS
+}
+
+stop() {
+       service_stop $YATE_BINARY
+}
+
+reload() {
+       service_reload $YATE_BINARY
+}
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to