[packages] strongswan: add init script
authorluka <luka@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 12 Apr 2013 15:05:38 +0000 (15:05 +0000)
committerluka <luka@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 12 Apr 2013 15:05:38 +0000 (15:05 +0000)
Signed-off-by: Luka Logar <luka.logar@cifra.si>
Signed-off-by: Luka Perkov <luka@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/packages@36319 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/strongswan/Makefile
net/strongswan/files/ipsec.init [new file with mode: 0644]

index eb71cfc..610d77c 100644 (file)
@@ -355,6 +355,8 @@ define Package/strongswan/install
        $(INSTALL_DIR) $(1)/usr/lib/ipsec
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{libstrongswan.so.*,libhydra.so.*} $(1)/usr/lib/ipsec/
        $(INSTALL_CONF) ./files/ipsec.secrets $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/ipsec.init $(1)/etc/init.d/ipsec
 endef
 
 define Package/strongswan-default/install
diff --git a/net/strongswan/files/ipsec.init b/net/strongswan/files/ipsec.init
new file mode 100644 (file)
index 0000000..391a2ae
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh /etc/rc.common
+
+START=90
+STOP=10
+
+start() {
+       ipsec start
+}
+
+stop() {
+       ipsec stop
+}
+
+restart() {
+       ipsec restart
+}
+
+reload() {
+       ipsec update
+}