Changeset 30244


Ignore:
Timestamp:
2012-02-05T16:57:49+01:00 (5 years ago)
Author:
jow
Message:

[packages_10.03.2] ptunnel: merge r29098, r29228

Location:
branches/packages_10.03.2/net/ptunnel
Files:
1 deleted
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/packages_10.03.2/net/ptunnel/Makefile

    r26065 r30244  
    11# 
    2 # Copyright (C) 2006-2009 OpenWrt.org 
     2# Copyright (C) 2006-2011 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:=1 
     12PKG_RELEASE:=3 
    1313 
    1414PKG_SOURCE:=PingTunnel-$(PKG_VERSION).tar.gz 
     
    5353define Package/ptunnel/install 
    5454        $(INSTALL_DIR) $(1)/usr/sbin 
    55         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ptunnel $(1)/usr/sbin/ 
     55        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ptunnel $(1)/usr/sbin/ 
    5656        $(INSTALL_DIR) $(1)/etc/init.d 
    5757        $(INSTALL_BIN) ./files/ptunnel.init $(1)/etc/init.d/ptunnel 
    5858        $(INSTALL_DIR) $(1)/etc/config 
    59         $(INSTALL_CONF) ./files/ptunnel.conf $(1)/etc/config/ptunnel 
     59        $(INSTALL_CONF) ./files/ptunnel.config $(1)/etc/config/ptunnel 
    6060endef 
    6161 
  • branches/packages_10.03.2/net/ptunnel/files/ptunnel.init

    r17608 r30244  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2007-2009 OpenWrt.org 
     2# Copyright (C) 2007-2011 OpenWrt.org 
    33 
    44START=70 
    5 BIN=ptunnel 
    6 PIDCOUNT=0 
    75 
    8 start() { 
    9         include /lib/network 
    10         scan_interfaces 
    11  
    12         config_load ptunnel 
    13         config_foreach start_ptunnel ptunnel 
    14         iptables -I OUTPUT 1 -p icmp -j ACCEPT 2> /dev/null 
    15 } 
    16  
    17 start_ptunnel() { 
     6start_instance() { 
    187        local section="$1" 
    198 
     
    2211 
    2312        [ -z "$ifname" ] && { 
    24                 echo "Error: Interface '$interface' not found" 1>&2 
     13                echo "${initscript}: Error: Interface '$interface' not found" 1>&2 
    2514                return 1 
    2615        } 
    2716 
    28         PIDCOUNT="$(( ${PIDCOUNT} + 1))" 
    29         ${BIN} -c "$ifname" -daemon /var/run/ptunnel."$PIDCOUNT".pid> /dev/null 
     17        SERVICE_PID_FILE="/var/run/ptunnel.$ifname.pid" 
     18        service_start /usr/sbin/ptunnel -c "$ifname" -daemon $SERVICE_PID_FILE 
     19} 
     20 
     21start() { 
     22        include /lib/network 
     23        scan_interfaces 
     24 
     25        config_load 'ptunnel' 
     26        config_foreach start_instance 'ptunnel' 
     27        iptables -I OUTPUT 1 -p icmp -j ACCEPT 2> /dev/null 
    3028} 
    3129 
    3230stop() { 
    33         local pidfile 
    34  
    35         for pidfile in `ls /var/run/${BIN}.*.pid` 
    36         do 
    37                 start-stop-daemon -K -s KILL -p "${pidfile}" -n "${BIN}" >/dev/null 
    38                 rm -f "${pidfile}" 
    39         done 
     31        service_stop /usr/sbin/ptunnel 
    4032} 
Note: See TracChangeset for help on using the changeset viewer.