git ssb

0+

cel / sslh



Tree: 00d5872aa176a23588f143551aa4b7e8dd1c0ca6

Files: 00d5872aa176a23588f143551aa4b7e8dd1c0ca6 / scripts / etc.rc.d.init.d.sslh.centos

1709 bytesRaw
1#!/bin/bash
2#
3# sslh Startup script for the SSL/SSH multiplexer
4#
5# chkconfig: - 13 87
6# description: Sslh accepts connections on specified ports, and forwards
7# them further based on tests performed on the first data
8# packet sent by the remote client.
9# processname: sslh
10# config: /etc/sslh.cfg
11# config: /etc/sysconfig/sslh
12# pidfile: /var/run/sslh/sslh.pid
13#
14# Authors:
15# Andre Krajnik akrajnik@gmail.com - 2010-03-20
16# Julien Thomas julthomas@free.fr - 2013-08-25
17
18# Source function library.
19. /etc/init.d/functions
20
21if [ -f /etc/sysconfig/sslh ]; then
22 . /etc/sysconfig/sslh
23fi
24
25PROGNAME=sslh
26SSLH=${SSLH:-/usr/sbin/sslh-select}
27SSLH_LANG=${SSLH_LANG:-C}
28CONFIG=${CONFIG:-/etc/sslh.cfg}
29PIDFILE=${PIDFILE:-/var/run/sslh/sslh.pid}
30LOCKFILE=${LOCKFILE:-/var/lock/subsys/sslh}
31STOP_TIMEOUT=${STOP_TIMEOUT:-10}
32RETVAL=0
33
34start() {
35 echo -n "Starting $PROGNAME: "
36 LANG=$SSLH_LANG daemon --pidfile="$PIDFILE" \
37 ${SSLH_USER:+--user="${SSLH_USER}"} \
38 "$SSLH" ${CONFIG:+-F "$CONFIG"} "$OPTIONS"
39 RETVAL=$?
40 echo
41 [ $RETVAL = 0 ] && touch "$LOCKFILE"
42 return $RETVAL
43}
44
45stop() {
46 echo -n "Stopping $PROGNAME: "
47 killproc -p "$PIDFILE" -d "$STOP_TIMEOUT" "$SSLH"
48 RETVAL=$?
49 echo
50 [ $RETVAL = 0 ] && rm -f "$LOCKFILE" "$PIDFILE"
51}
52
53# See how we were called.
54case "$1" in
55 start)
56 start
57 ;;
58 stop)
59 stop
60 ;;
61 status)
62 status -p "$PIDFILE" "$SSLH"
63 RETVAL=$?
64 ;;
65 restart)
66 stop
67 start
68 ;;
69 *)
70 echo "Usage: $PROGNAME {start|stop|status|restart}"
71 RETVAL=2
72 ;;
73esac
74
75exit $RETVAL
76

Built with git-ssb-web