[packages] ptunnel: use network.sh to find device, remove iptables rules on stop added in start
git-svn-id: svn://svn.openwrt.org/openwrt/packages@31970 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
88bac66cf0
commit
4997a53386
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2006-2011 OpenWrt.org
|
# Copyright (C) 2006-2012 OpenWrt.org
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=ptunnel
|
PKG_NAME:=ptunnel
|
||||||
PKG_VERSION:=0.71
|
PKG_VERSION:=0.71
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=4
|
||||||
|
|
||||||
PKG_SOURCE:=PingTunnel-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=PingTunnel-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=http://www.cs.uit.no/~daniels/PingTunnel
|
PKG_SOURCE_URL:=http://www.cs.uit.no/~daniels/PingTunnel
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
# Copyright (C) 2007-2011 OpenWrt.org
|
# Copyright (C) 2007-2012 OpenWrt.org
|
||||||
|
|
||||||
START=70
|
START=70
|
||||||
|
|
||||||
@ -7,9 +7,7 @@ start_instance() {
|
|||||||
local section="$1"
|
local section="$1"
|
||||||
|
|
||||||
config_get interface "$section" interface
|
config_get interface "$section" interface
|
||||||
config_get ifname "$interface" ifname
|
network_get_device ifname "$interface" || {
|
||||||
|
|
||||||
[ -z "$ifname" ] && {
|
|
||||||
echo "${initscript}: Error: Interface '$interface' not found" 1>&2
|
echo "${initscript}: Error: Interface '$interface' not found" 1>&2
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
@ -19,8 +17,7 @@ start_instance() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
include /lib/network
|
. /lib/functions/network.sh
|
||||||
scan_interfaces
|
|
||||||
|
|
||||||
config_load 'ptunnel'
|
config_load 'ptunnel'
|
||||||
config_foreach start_instance 'ptunnel'
|
config_foreach start_instance 'ptunnel'
|
||||||
@ -29,4 +26,5 @@ start() {
|
|||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
service_stop /usr/sbin/ptunnel
|
service_stop /usr/sbin/ptunnel
|
||||||
|
iptables -D OUTPUT -p icmp -j ACCEPT 2>/dev/null
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user