1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-31 10:46:16 +00:00
freebsd-ports/net/sslh/files/sslh.in
Vanilla I. Shu 28b6189d00 Upgrade to 1.17.
PR:		198493
Submitted by:	maintainer
2015-03-12 08:43:18 +00:00

59 lines
1.2 KiB
Bash

#!/bin/sh
# $FreeBSD$
#
# sslh startup script
#
# PROVIDE: sslh
# REQUIRE: LOGIN FILESYSTEMS ldconfig sshd
# KEYWORD: shutdown
#
# Add the following to /etc/rc.conf[.local] to enable this service:
# sslh_enable="YES"
#
# You can fine tune other variables too:
# sslh_mode="fork | select"
# fork: stable but slow performance
# select: new but high performance
# sslh_fib: routing table number
sslh_precmd() {
if command -v check_namevarlist > /dev/null 2>&1; then
check_namevarlist fib && return 0
fi
sysctl net.fibs > /dev/null 2>&1 || return 0
sslh_fib=${sslh_fib:-"NONE"}
case "$sslh_fib" in
[Nn][Oo][Nn][Ee])
;;
*)
command="setfib -F ${sslh_fib} ${command}"
;;
esac
}
. /etc/rc.subr
name="sslh"
rcvar=sslh_enable
start_precmd="sslh_precmd"
load_rc_config $name
sslh_enable=${sslh_enable:-"NO"}
sslh_mode=${sslh_mode:-"fork"}
required_files="%%PREFIX%%/etc/${name}.conf"
for value in listening openvpntarget sshtarget sshtimeout ssltarget \
tinctarget xmpptarget; do
eval "[ -n \"\${sslh_${value}}\" ]" && \
warn "${name}_${value} no longer used: configuration file available"
done
command="%%PREFIX%%/sbin/${name}-${sslh_mode}"
command_args="-F%%PREFIX%%/etc/${name}.conf"
run_rc_command "$1"