Files: 9bcb2cdd7a920ebc78b59d0b5797d678424aa93a / scripts / etc.init.d.sslh
998 bytesRaw
1 | #! /bin/sh |
2 | |
3 | ### BEGIN INIT INFO |
4 | # Provides: sslh |
5 | # Default-Start: 2 3 4 5 |
6 | # Default-Stop: 1 |
7 | # Short-Description: sslh proxy ssl & ssh connections |
8 | ### END INIT INFO |
9 | |
10 | set -e |
11 | tag=sslh |
12 | facility=user.info |
13 | |
14 | # /etc/init.d/sslh: start and stop the sslh proxy daemon |
15 | |
16 | if test -f /etc/default/sslh; then |
17 | . /etc/default/sslh |
18 | fi |
19 | |
20 | # The prefix is normally filled by make install. If |
21 | # installing by hand, fill it in yourself! |
22 | PREFIX= |
23 | DAEMON=$PREFIX/sbin/sslh |
24 | |
25 | start() |
26 | { |
27 | echo "Start services: sslh" |
28 | $DAEMON --user ${USER} --pidfile ${PID} --listen ${LISTEN} --ssh ${SSH} --ssl ${SSL} |
29 | logger -t ${tag} -p ${facility} -i 'Started sslh' |
30 | } |
31 | |
32 | stop() |
33 | { |
34 | echo "Stop services: sslh" |
35 | killall $DAEMON |
36 | logger -t ${tag} -p ${facility} -i 'Stopped sslh' |
37 | } |
38 | |
39 | |
40 | case "$1" in |
41 | start) |
42 | start |
43 | ;; |
44 | stop) |
45 | stop |
46 | ;; |
47 | restart) |
48 | stop |
49 | sleep 5 |
50 | start |
51 | ;; |
52 | *) |
53 | echo "Usage: /etc/init.d/sslh {start|stop|restart}" >&2 |
54 | ;; |
55 | esac |
56 | |
57 | exit 0 |
58 |
Built with git-ssb-web