From: John Crispin Date: Thu, 31 Jan 2008 18:12:33 +0000 (+0000) Subject: add init.d script to openslp X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;h=95a09e9c0acfb2e83d7cedbf5e8e6212bdbab23d add init.d script to openslp SVN-Revision: 10342 --- diff --git a/net/openslp/Makefile b/net/openslp/Makefile index 0dbe50db20..dcccbe5edc 100644 --- a/net/openslp/Makefile +++ b/net/openslp/Makefile @@ -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 index 0000000000..2b5e727533 --- /dev/null +++ b/net/openslp/files/etc/init.d/slpd @@ -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 index 0000000000..ca434ead6e --- /dev/null +++ b/net/openslp/files/etc/slp.conf @@ -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 index 0000000000..44fdae3145 --- /dev/null +++ b/net/openslp/files/etc/slp.reg @@ -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 index 0000000000..e69de29bb2 diff --git a/net/openslp/files/slp.conf b/net/openslp/files/slp.conf deleted file mode 100644 index ca434ead6e..0000000000 --- a/net/openslp/files/slp.conf +++ /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 index 73b8ec2eb0..0000000000 --- a/net/openslp/files/slp.reg +++ /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 index e69de29bb2..0000000000