]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/sslh/S35sslh
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / sslh / S35sslh
1 #!/bin/sh
2 #
3 # Starts the SSLH server
4 #
5
6 # default setup : listen on port 8090 forward ssh traffic to
7 # localhost:22 and http traffic to localhost:80
8 SSLH_ARGS="--listen 0.0.0.0:8090 --ssh 127.0.0.1:22 --http 127.0.0.1:80"
9
10 # Allow a few customizations from a config file (overrides
11 # default setup)
12 test -r /etc/default/sslh && . /etc/default/sslh
13
14 start() {
15         SSLH_ARGS="$SSLH_ARGS --user root"
16         echo -n "Starting sslh: "
17         start-stop-daemon -S -q -p /var/run/sslh.pid \
18                 --exec /usr/sbin/sslh -- $SSLH_ARGS
19         [ $? = 0 ] && echo "OK" || echo "FAIL"
20 }
21
22 stop() {
23         printf "Stopping sslh: "
24         start-stop-daemon -K -q -p /var/run/sslh.pid
25         [ $? = 0 ] && echo "OK" || echo "FAIL"
26 }
27
28 restart() {
29         stop
30         start
31 }
32
33 case "$1" in
34   start)
35         start
36         ;;
37   stop)
38         stop
39         ;;
40   restart|reload)
41         restart
42         ;;
43   *)
44         echo "Usage: $0 {start|stop|restart}"
45         exit 1
46 esac
47
48 exit $?