Apply ptunnel patches from #2884
[openwrt/svn-archive/archive.git] / net / ptunnel / files / ptunnel.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2007 OpenWrt.org
3 START=70
4 BIN=ptunnel
5
6 start() {
7 config_load ptunnel
8 config_foreach start_ptunnel ptunnel
9 }
10
11 start_ptunnel() {
12 local section="$1"
13
14 include /lib/network
15 scan_interfaces
16
17 iptables -I OUTPUT 1 -p icmp -j ACCEPT
18 config_get interface "$section" interface
19
20 $BIN -c "$interface" > /dev/null&
21 }
22
23 stop() {
24 ps aux | grep ptunnel | awk '{print }' | \
25 xargs kill 2> /dev/null
26 }
27