daed372bde
git-svn-id: svn://svn.openwrt.org/openwrt/packages@10085 3c298f89-4303-0410-b956-a3cf2f4a3e73
27 lines
554 B
Bash
27 lines
554 B
Bash
#!/bin/sh /etc/rc.common
|
|
# Copyright (C) 2007 OpenWrt.org
|
|
START=70
|
|
BIN=hts
|
|
|
|
start_httptunnel() {
|
|
local section="$1"
|
|
|
|
config_get destination "$section" destination
|
|
config_get sourceport "$section" sourceport
|
|
|
|
echo start httptunnel: dest: "$destination", src: "$sourceport"
|
|
|
|
$BIN --forward-port "$destination" "$sourceport"
|
|
}
|
|
|
|
|
|
start() {
|
|
config_load httptunnel
|
|
config_foreach start_httptunnel httptunnel
|
|
}
|
|
|
|
stop() {
|
|
ps aux | grep hts | awk '{print }' | \
|
|
xargs kill 2> /dev/null
|
|
}
|
|
|