summaryrefslogtreecommitdiffstats
path: root/net-misc/httptunnel/files/htc
blob: c06fcb162e2001d43375c1a734034c73c57cf1c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:

depend() {
    need net
}

start() {
    ebegin "Starting httptunnel (client)"

    htc_args=""
    if [ -n "$HTC_PROXY" ]; then
	htc_args="$htc_args -P $HTC_PROXY"
    fi

    if [ -n "$HTC_SERVICE_PORT" ]; then
	htc_args="$htc_args -F $HTC_SERVICE_PORT"
    fi

    start-stop-daemon --start --quiet --exec /usr/bin/htc -c nobody -- $htc_args $HTC_SERVER:$HTC_PORT

    eend $?
}

stop() {
    ebegin "Stopping httptunnel (client)"
    start-stop-daemon --stop --retry 5 --quiet --name htc
    eend $?
}