From 262da9d134a2af9c0717eca5b2371f86df69903c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 29 May 2012 01:19:54 +0000 Subject: [PATCH] [packages] ptunnel: use network.sh to find device, remove iptables rules on stop added in start SVN-Revision: 31970 --- net/ptunnel/Makefile | 4 ++-- net/ptunnel/files/ptunnel.init | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/net/ptunnel/Makefile b/net/ptunnel/Makefile index 52e9558582..d140d4a74c 100644 --- a/net/ptunnel/Makefile +++ b/net/ptunnel/Makefile @@ -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. # See /LICENSE for more information. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ptunnel PKG_VERSION:=0.71 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=PingTunnel-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.cs.uit.no/~daniels/PingTunnel diff --git a/net/ptunnel/files/ptunnel.init b/net/ptunnel/files/ptunnel.init index 9524909b01..3b10d41d94 100644 --- a/net/ptunnel/files/ptunnel.init +++ b/net/ptunnel/files/ptunnel.init @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2007-2011 OpenWrt.org +# Copyright (C) 2007-2012 OpenWrt.org START=70 @@ -7,9 +7,7 @@ start_instance() { local section="$1" config_get interface "$section" interface - config_get ifname "$interface" ifname - - [ -z "$ifname" ] && { + network_get_device ifname "$interface" || { echo "${initscript}: Error: Interface '$interface' not found" 1>&2 return 1 } @@ -19,14 +17,14 @@ start_instance() { } start() { - include /lib/network - scan_interfaces + . /lib/functions/network.sh config_load 'ptunnel' config_foreach start_instance 'ptunnel' - iptables -I OUTPUT 1 -p icmp -j ACCEPT 2> /dev/null + iptables -I OUTPUT 1 -p icmp -j ACCEPT 2>/dev/null } stop() { service_stop /usr/sbin/ptunnel + iptables -D OUTPUT -p icmp -j ACCEPT 2>/dev/null } -- 2.30.2