Files: 0658982705270b6f79c5387db43e95e7c1f67465 / scripts / etc.init.d.sslh
1097 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 | # Defaults -- can be overridden in /etc/default/sslh |
17 | LISTEN=thelonious:443 |
18 | SSH=localhost:22 |
19 | SSL=localhost:443 |
20 | |
21 | if test -f /etc/default/sslh; then |
22 | . /etc/default/sslh |
23 | fi |
24 | |
25 | # The prefix is normally filled by make install. If |
26 | # installing by hand, fill it in yourself! |
27 | PREFIX= |
28 | DAEMON=$PREFIX/sbin/sslh |
29 | |
30 | start() |
31 | { |
32 | echo "Start services: sslh" |
33 | $DAEMON -u nobody -p ${LISTEN} -s ${SSH} -l ${SSL} |
34 | logger -t ${tag} -p ${facility} -i 'Started sslh' |
35 | } |
36 | |
37 | stop() |
38 | { |
39 | echo "Stop services: sslh" |
40 | killall $DAEMON |
41 | rm ${PIDFILE} |
42 | logger -t ${tag} -p ${facility} -i 'Stopped sslh' |
43 | } |
44 | |
45 | |
46 | case "$1" in |
47 | start) |
48 | start |
49 | ;; |
50 | stop) |
51 | stop |
52 | ;; |
53 | restart) |
54 | stop |
55 | sleep 5 |
56 | start |
57 | ;; |
58 | *) |
59 | echo "Usage: /etc/init.d/sslh {start|stop|restart}" >&2 |
60 | ;; |
61 | esac |
62 | |
63 | exit 0 |
64 |
Built with git-ssb-web