mirror of
https://github.com/yrutschle/sslh.git
synced 2025-04-20 18:57:39 +03:00
Added CentOS init.d script (Andre Krajnik). Fixed default ssl address inconsistancy, now defaults to "localhost:443" and fixed documentation accordingly (pointed by Markus Schalke). Children no longer bind to the listen socket, so parent server can be stopped without killing an active child (pointed by Matthias Buecher). Inetd support (Dima Barsky).
63 lines
1.0 KiB
Bash
Executable File
63 lines
1.0 KiB
Bash
Executable File
#! /bin/sh
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: sslh
|
|
# 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
|
|
|
|
# Defaults -- can be overridden in /etc/default/sslh
|
|
LISTEN=thelonious:443
|
|
SSH=localhost:22
|
|
SSL=localhost:443
|
|
|
|
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 -u nobody -p ${LISTEN} -s ${SSH} -l ${SSL}
|
|
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
|