File: etc.init.d.sslh

package info (click to toggle)
sslh 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,960 kB
  • sloc: ansic: 7,681; perl: 683; sh: 356; makefile: 136
file content (59 lines) | stat: -rwxr-xr-x 1,017 bytes parent folder | download | duplicates (3)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#! /bin/sh

### BEGIN INIT INFO
# Provides:		sslh
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:	2 3 4 5
# Default-Stop:		1
# Short-Description:	sslh proxy ssl & ssh connections
### END INIT INFO

set -e
tag=sslh
facility=user.info

# /etc/init.d/sslh: start and stop the sslh proxy daemon

if test -f /etc/default/sslh; then
    . /etc/default/sslh
fi

# The prefix is normally filled by make install. If
# installing by hand, fill it in yourself!
PREFIX=
DAEMON=$PREFIX/sbin/sslh 

start()
{
        echo "Start services: sslh"
        $DAEMON -F/etc/sslh.cfg
        logger -t ${tag} -p ${facility} -i 'Started sslh'
}

stop()
{
        echo "Stop services: sslh"
	killall $DAEMON
      	logger -t ${tag} -p ${facility} -i 'Stopped sslh'
}


case "$1" in
	  start)
		    start
		    ;;
	  stop)
		    stop
		    ;;
    restart)
		    stop
		    sleep 5
		    start
		    ;;
	  *)
		    echo "Usage: /etc/init.d/sslh {start|stop|restart}" >&2
		    ;;
esac

exit 0