Changeset 31970


Ignore:
Timestamp:
2012-05-29T03:19:54+02:00 (6 years ago)
Author:
jow
Message:

[packages] ptunnel: use network.sh to find device, remove iptables rules on stop added in start

Location:
packages/net/ptunnel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • packages/net/ptunnel/Makefile

    r29228 r31970  
    11# 
    2 # Copyright (C) 2006-2011 OpenWrt.org 
     2# Copyright (C) 2006-2012 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    1010PKG_NAME:=ptunnel 
    1111PKG_VERSION:=0.71 
    12 PKG_RELEASE:=3 
     12PKG_RELEASE:=4 
    1313 
    1414PKG_SOURCE:=PingTunnel-$(PKG_VERSION).tar.gz 
  • packages/net/ptunnel/files/ptunnel.init

    r29098 r31970  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2007-2011 OpenWrt.org 
     2# Copyright (C) 2007-2012 OpenWrt.org 
    33 
    44START=70 
     
    88 
    99        config_get interface "$section" interface 
    10         config_get ifname "$interface" ifname 
    11  
    12         [ -z "$ifname" ] && { 
     10        network_get_device ifname "$interface" || { 
    1311                echo "${initscript}: Error: Interface '$interface' not found" 1>&2 
    1412                return 1 
     
    2018 
    2119start() { 
    22         include /lib/network 
    23         scan_interfaces 
     20        . /lib/functions/network.sh 
    2421 
    2522        config_load 'ptunnel' 
    2623        config_foreach start_instance 'ptunnel' 
    27         iptables -I OUTPUT 1 -p icmp -j ACCEPT 2> /dev/null 
     24        iptables -I OUTPUT 1 -p icmp -j ACCEPT 2>/dev/null 
    2825} 
    2926 
    3027stop() { 
    3128        service_stop /usr/sbin/ptunnel 
     29        iptables -D OUTPUT -p icmp -j ACCEPT 2>/dev/null 
    3230} 
Note: See TracChangeset for help on using the changeset viewer.