packages/gw6c: use new service functions
git-svn-id: svn://svn.openwrt.org/openwrt/packages@28923 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
55c1bbe5d8
commit
1f73407f58
@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gw6c
|
||||
PKG_VERSION:=5.1
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=http://openwrt.linux-appliance.net/sources
|
||||
|
@ -1,12 +1,17 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#Copyright (C) 2007 RoadRunner.cx
|
||||
# Copyright (C) 2007-2011 OpenWrt.org
|
||||
# Copyright (C) 2007 RoadRunner.cx
|
||||
|
||||
START=52
|
||||
|
||||
SERVICE_DAEMONIZE=1
|
||||
SERVICE_WRITE_PID=1
|
||||
|
||||
genconf() {
|
||||
|
||||
[ -f /etc/config/gw6c ] || {
|
||||
echo "You are missing configuration file /etc/config/gw6c"
|
||||
return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
config_load "gw6c"
|
||||
@ -15,7 +20,7 @@ genconf() {
|
||||
|
||||
[ "$DISABLED" == "1" ] && {
|
||||
echo "You haven't edited your configuration file. Gateway6 is disabled."
|
||||
return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
config_get USERID basic userid
|
||||
@ -94,18 +99,13 @@ EOF
|
||||
|
||||
start() {
|
||||
genconf
|
||||
if [ -z "$GW6C_CONF" ] || [ ! -f "$GW6C_CONF" ]; then
|
||||
echo "Gateway6 client cannot start."
|
||||
else
|
||||
echo "Starting Gateway6 client."
|
||||
/usr/sbin/gw6c -f "$GW6C_CONF"
|
||||
fi
|
||||
[ -n "$GW6C_CONF" ] || return 1
|
||||
[ -f "$GW6C_CONF" ] || return 1
|
||||
service_start /usr/sbin/gw6c -f "$GW6C_CONF"
|
||||
}
|
||||
|
||||
stop() {
|
||||
[ `ps ax|grep -v grep|grep -c gw6c` != "0" ] && {
|
||||
killall -q gw6c
|
||||
[ `ps ax|grep -v grep|grep -c radvd` != "0" ] && killall -q radvd
|
||||
service_stop /usr/sbin/gw6c && {
|
||||
echo 0 > /proc/sys/net/ipv6/conf/all/forwarding
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user