From 68e327c9cbcee0b8715b7ad3258d1ae334e0f263 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 27 Aug 2009 09:02:22 +0000 Subject: [PATCH] [package] add igmpproxy init script (#5758) git-svn-id: svn://svn.openwrt.org/openwrt/packages@17425 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/igmpproxy/Makefile | 4 +++- net/igmpproxy/files/igmpproxy.init | 42 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 net/igmpproxy/files/igmpproxy.init diff --git a/net/igmpproxy/Makefile b/net/igmpproxy/Makefile index c65d8f803..3011aa6ec 100644 --- a/net/igmpproxy/Makefile +++ b/net/igmpproxy/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=igmpproxy PKG_VERSION:=0.1_beta5 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/igmpproxy @@ -44,6 +44,8 @@ endef define Package/igmpproxy/install $(INSTALL_DIR) $(1)/etc $(INSTALL_CONF) ./files/igmpproxy.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/igmpproxy.init $(1)/etc/init.d/igmpproxy $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/igmpproxy $(1)/usr/sbin/ endef diff --git a/net/igmpproxy/files/igmpproxy.init b/net/igmpproxy/files/igmpproxy.init new file mode 100644 index 000000000..c2d3d8c84 --- /dev/null +++ b/net/igmpproxy/files/igmpproxy.init @@ -0,0 +1,42 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=99 +DEBUG=0 +# +# The debug flag should generally be set to 0 +# otherwise igmpproxy will spam your syslog. +# However, this is very useful for debugging +# a non-functional configuration file. +# +# DEBUG=0 = NO DEBUG!!! +# DEBUG=1 -d +# DEBUG=2 -v +# DEBUG=3 -v -v +LOGFILE="/root/igmpproxy.log" +start() { + echo -n "Starting igmpproxy" + # Normal Mode + if [ $DEBUG -eq 0 ]; then + echo " in normal mode" + /usr/sbin/igmpproxy /etc/igmpproxy.conf & + # Debug Mode + elif [ $DEBUG -eq 1 ]; then + echo " in debug mode" + /usr/sbin/igmpproxy -d /etc/igmpproxy.conf & + # Verbose Mode + elif [ $DEBUG -eq 2 ]; then + echo " in verbose mode" + /usr/sbin/igmpproxy -v /etc/igmpproxy.conf & + # Very Verbose Mode + elif [ $DEBUG -eq 3 ]; then + echo " in very verbose mode" + /usr/sbin/igmpproxy -v -v /etc/igmpproxy.conf & + else + echo " unkown debug mode, must be 0, 1, 2 or 3" + fi +} + +stop() { + echo "Killing igmpporxy" + killall igmpproxy +} -- 2.11.0