2007-12-21 09:34:01 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2007 OpenWrt.org
|
|
|
|
START=70
|
2008-01-10 18:25:04 +00:00
|
|
|
BIN=ptunnel
|
2007-12-21 09:34:01 +00:00
|
|
|
|
|
|
|
start() {
|
2008-01-10 18:25:04 +00:00
|
|
|
config_load ptunnel
|
|
|
|
config_foreach start_ptunnel ptunnel
|
2007-12-21 09:34:01 +00:00
|
|
|
}
|
2008-01-10 18:25:04 +00:00
|
|
|
|
|
|
|
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&
|
|
|
|
}
|
|
|
|
|
2007-12-21 09:34:01 +00:00
|
|
|
stop() {
|
2008-01-10 18:25:04 +00:00
|
|
|
ps aux | grep ptunnel | awk '{print }' | \
|
|
|
|
xargs kill 2> /dev/null
|
2007-12-21 09:34:01 +00:00
|
|
|
}
|
2008-01-10 18:25:04 +00:00
|
|
|
|