2013-07-10 17:09:40 -04:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: sslh
|
2013-07-10 17:19:33 -04:00
|
|
|
# Required-Start: $remote_fs $syslog
|
|
|
|
# Required-Stop: $remote_fs $syslog
|
2013-07-10 17:09:40 -04:00
|
|
|
# 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
|
|
|
|
|
2013-07-10 17:10:43 -04:00
|
|
|
# The prefix is normally filled by make install. If
|
|
|
|
# installing by hand, fill it in yourself!
|
|
|
|
PREFIX=
|
|
|
|
DAEMON=$PREFIX/sbin/sslh
|
2013-07-10 17:09:40 -04:00
|
|
|
|
|
|
|
start()
|
|
|
|
{
|
|
|
|
echo "Start services: sslh"
|
2015-01-01 12:59:05 -05:00
|
|
|
$DAEMON -F /etc/sslh.cfg
|
2013-07-10 17:09:40 -04:00
|
|
|
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
|