From 00ea0a2f46f4824a293a430bbe403ee4d7cba7e1 Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 31 Jan 2008 18:12:33 +0000 Subject: [PATCH] add init.d script to openslp git-svn-id: svn://svn.openwrt.org/openwrt/packages@10342 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/openslp/Makefile | 5 +++-- net/openslp/files/etc/init.d/slpd | 14 ++++++++++++++ net/openslp/files/{ => etc}/slp.conf | 0 net/openslp/files/etc/slp.reg | 2 ++ net/openslp/files/{ => etc}/slp.spi | 0 net/openslp/files/slp.reg | 2 -- 6 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 net/openslp/files/etc/init.d/slpd rename net/openslp/files/{ => etc}/slp.conf (100%) create mode 100644 net/openslp/files/etc/slp.reg rename net/openslp/files/{ => etc}/slp.spi (100%) delete mode 100644 net/openslp/files/slp.reg diff --git a/net/openslp/Makefile b/net/openslp/Makefile index 0dbe50db2..dcccbe5ed 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 000000000..2b5e72753 --- /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/slp.conf b/net/openslp/files/etc/slp.conf similarity index 100% rename from net/openslp/files/slp.conf rename to net/openslp/files/etc/slp.conf diff --git a/net/openslp/files/etc/slp.reg b/net/openslp/files/etc/slp.reg new file mode 100644 index 000000000..44fdae314 --- /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/slp.spi b/net/openslp/files/etc/slp.spi similarity index 100% rename from net/openslp/files/slp.spi rename to net/openslp/files/etc/slp.spi diff --git a/net/openslp/files/slp.reg b/net/openslp/files/slp.reg deleted file mode 100644 index 73b8ec2eb..000000000 --- a/net/openslp/files/slp.reg +++ /dev/null @@ -1,2 +0,0 @@ -service:device.AP://192.168.1.1,en,65535 -use default scopes