mirror of
https://github.com/moparisthebest/sslh
synced 2024-11-27 19:42:21 -05:00
b09c3aab31
Per the changelog for 1.17: argument to -F can no longer be separated from the option by a space, e.g. must be -Ffoo.cfg). This fixes the `/etc/sslh/sslh.cfg:file I/O error` message if the config file is stored in `/etc/sslh.cfg` as given by Readme.md.
60 lines
1017 B
Bash
Executable File
60 lines
1017 B
Bash
Executable File
#! /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
|