packages/net/httptunnel/files/httptunnel.init
florian daed372bde Add httptunnel UCI config and init script from #2886
git-svn-id: svn://svn.openwrt.org/openwrt/packages@10085 3c298f89-4303-0410-b956-a3cf2f4a3e73
2008-01-02 15:19:27 +00:00

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
}