packages/reaim: use new service functions

git-svn-id: svn://svn.openwrt.org/openwrt/packages@28966 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nico 2011-11-12 01:30:23 +00:00
parent 9e4c97e67d
commit 5307723017
2 changed files with 6 additions and 28 deletions

View File

@ -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

View File

@ -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
}