packages/net/ptunnel/files/ptunnel.init
acinonyx f802a822a2 [packages] ptunnel: Update to v0.71 (#5824)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@17605 3c298f89-4303-0410-b956-a3cf2f4a3e73
2009-09-19 12:11:46 +00:00

27 lines
489 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2007-2009 OpenWrt.org
START=70
BIN=ptunnel
start() {
config_load ptunnel
config_foreach start_ptunnel ptunnel
}
start_ptunnel() {
local section="$1"
include /lib/network
scan_interfaces
iptables -I OUTPUT 1 -p icmp -j ACCEPT
config_get interface "$section" interface
$BIN -c "$interface" > /dev/null&
}
stop() {
ps aux | grep ptunnel | awk '{print }' | \
xargs kill 2> /dev/null
}