add init.d script to openslp
authorJohn Crispin <john@openwrt.org>
Thu, 31 Jan 2008 18:12:33 +0000 (18:12 +0000)
committerJohn Crispin <john@openwrt.org>
Thu, 31 Jan 2008 18:12:33 +0000 (18:12 +0000)
SVN-Revision: 10342

net/openslp/Makefile
net/openslp/files/etc/init.d/slpd [new file with mode: 0644]
net/openslp/files/etc/slp.conf [new file with mode: 0644]
net/openslp/files/etc/slp.reg [new file with mode: 0644]
net/openslp/files/etc/slp.spi [new file with mode: 0644]
net/openslp/files/slp.conf [deleted file]
net/openslp/files/slp.reg [deleted file]
net/openslp/files/slp.spi [deleted file]

index 0dbe50db209494fe64bbf624e78b2c5a5fadb990..dcccbe5edcaec87ecbaf07917856cc820382adf1 100644 (file)
@@ -32,11 +32,12 @@ endef
 #      all
 
 define Package/openslp/install
-       $(INSTALL_DIR) $(1)/etc $(1)/lib $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/etc $(1)/lib $(1)/usr/bin $(1)/etc/init.d
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/slpd/slpd $(1)/usr/bin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/slptool/.libs/slptool $(1)/usr/bin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/libslp/.libs/libslp.so* $(1)/lib
-       $(INSTALL_DATA) ./files/* $(1)/etc
+       $(INSTALL_DATA) ./files/etc/slp.* $(1)/etc
+       $(INSTALL_BIN) ./files/etc/init.d/* $(1)/etc/init.d
 endef
 
 $(eval $(call BuildPackage,openslp))
diff --git a/net/openslp/files/etc/init.d/slpd b/net/openslp/files/etc/init.d/slpd
new file mode 100644 (file)
index 0000000..2b5e727
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2008 OpenWrt.org
+START=50
+
+start() {
+       cp /etc/slp* /var
+       IP=`ifconfig br-lan | grep inet | cut -d" " -f12 | cut -d: -f2`
+       sed -i "s/IPADDR/${IP}/g" /var/slp.reg
+       slpd -r /var/slp.reg -c /var/slp.conf
+}
+
+stop() {
+       killall slpd
+}
diff --git a/net/openslp/files/etc/slp.conf b/net/openslp/files/etc/slp.conf
new file mode 100644 (file)
index 0000000..ca434ea
--- /dev/null
@@ -0,0 +1,28 @@
+;net.slp.useScopes = myScope1, myScope2, myScope3
+;net.slp.DAAddresses = myDa1,myDa2,myDa3
+;net.slp.isDA = true
+;net.slp.DAHeartBeat = 10800
+;net.slp.watchRegistrationPID = false
+;net.slp.maxResults = 256
+;net.slp.isBroadcastOnly = true
+;net.slp.passiveDADetection = false
+;net.slp.activeDADetection = false
+;net.slp.DAActiveDiscoveryInterval = 1
+;net.slp.multicastTTL = 255
+;net.slp.DADiscoveryMaximumWait = 2000
+;net.slp.DADiscoveryTimeouts = 500,750,1000,1500,2000,3000
+;net.slp.multicastMaximumWait = 5000
+;net.slp.multicastTimeouts  = 500,750,1000,1500,2000,3000
+;net.slp.unicastMaximumWait = 5000 
+;net.slp.unicastTimeouts  = 500,750,1000,1500,2000,3000
+;net.slp.datagramTimeouts = IGNORED
+;net.slp.randomWaitBound = 5000
+;net.slp.MTU = 1400
+;net.slp.interfaces = 1.2.3.4,1.2.3.5,1.2.3.6
+;net.slp.securityEnabled=true
+;net.slp.checkSourceAddr=false
+
+;net.slp.traceDATraffic = true
+;net.slp.traceReg = true
+;net.slp.traceDrop = true
+;net.slp.traceMsg = true
diff --git a/net/openslp/files/etc/slp.reg b/net/openslp/files/etc/slp.reg
new file mode 100644 (file)
index 0000000..44fdae3
--- /dev/null
@@ -0,0 +1,2 @@
+service:device.AP://IPADDR,en,65535 
+use default scopes
diff --git a/net/openslp/files/etc/slp.spi b/net/openslp/files/etc/slp.spi
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/net/openslp/files/slp.conf b/net/openslp/files/slp.conf
deleted file mode 100644 (file)
index ca434ea..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-;net.slp.useScopes = myScope1, myScope2, myScope3
-;net.slp.DAAddresses = myDa1,myDa2,myDa3
-;net.slp.isDA = true
-;net.slp.DAHeartBeat = 10800
-;net.slp.watchRegistrationPID = false
-;net.slp.maxResults = 256
-;net.slp.isBroadcastOnly = true
-;net.slp.passiveDADetection = false
-;net.slp.activeDADetection = false
-;net.slp.DAActiveDiscoveryInterval = 1
-;net.slp.multicastTTL = 255
-;net.slp.DADiscoveryMaximumWait = 2000
-;net.slp.DADiscoveryTimeouts = 500,750,1000,1500,2000,3000
-;net.slp.multicastMaximumWait = 5000
-;net.slp.multicastTimeouts  = 500,750,1000,1500,2000,3000
-;net.slp.unicastMaximumWait = 5000 
-;net.slp.unicastTimeouts  = 500,750,1000,1500,2000,3000
-;net.slp.datagramTimeouts = IGNORED
-;net.slp.randomWaitBound = 5000
-;net.slp.MTU = 1400
-;net.slp.interfaces = 1.2.3.4,1.2.3.5,1.2.3.6
-;net.slp.securityEnabled=true
-;net.slp.checkSourceAddr=false
-
-;net.slp.traceDATraffic = true
-;net.slp.traceReg = true
-;net.slp.traceDrop = true
-;net.slp.traceMsg = true
diff --git a/net/openslp/files/slp.reg b/net/openslp/files/slp.reg
deleted file mode 100644 (file)
index 73b8ec2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-service:device.AP://192.168.1.1,en,65535 
-use default scopes
diff --git a/net/openslp/files/slp.spi b/net/openslp/files/slp.spi
deleted file mode 100644 (file)
index e69de29..0000000