From 59c008c5e79ce3dcb25d67ed7ebf29d34401865a Mon Sep 17 00:00:00 2001 From: Nicolas Thill Date: Sat, 12 Nov 2011 01:30:23 +0000 Subject: [PATCH] packages/reaim: use new service functions SVN-Revision: 28966 --- net/reaim/Makefile | 4 ++-- net/reaim/files/reaim.init | 30 ++++-------------------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/net/reaim/Makefile b/net/reaim/Makefile index 120180185f..6c5c4abff2 100644 --- a/net/reaim/Makefile +++ b/net/reaim/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006-2011 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reaim PKG_VERSION:=0.8 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/reaim diff --git a/net/reaim/files/reaim.init b/net/reaim/files/reaim.init index d6e8cb72d3..39c0cf8d97 100644 --- a/net/reaim/files/reaim.init +++ b/net/reaim/files/reaim.init @@ -1,10 +1,8 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006-2011 OpenWrt.org START=60 -PATH=/sbin:/bin:/usr/sbin:/usr/bin -NAME=reaim -DESC="Transparent proxy for IM behind NAT" + IPT=/usr/sbin/iptables set_rules() { @@ -20,29 +18,9 @@ set_rules() { } start() { - if [ -e /var/run/$NAME.pid ]; then - echo "$DESC: $NAME already started." - exit 0 - fi - echo -n "Starting $DESC: $NAME" - - set_rules -A - test -e /var/run/$NAME.pid || touch /var/run/$NAME.pid - /usr/sbin/$NAME - echo "." + service_start /usr/sbin/reaim && set_rules -A } stop() { - set_rules -D 2>/dev/null >/dev/null - - if [ ! -e /var/run/$NAME.pid ]; then - echo "$DESC: $NAME is not running." - exit 0 - fi - echo -n "Stopping $DESC: $NAME" - - killall $NAME - rm -f /var/run/$NAME.pid - - echo "." + service_stop /usr/sbin/reaim && set_rules -D } -- 2.30.2