Add rc script

PR:		ports/148170
Submitted by:	Olivier Cochard-Labbé <olivier _at_ cochard.me>
Approved by:	rene@ (mentor vacation), Jui-Nan Lin <jnlin _at_ csie.nctu.edu.tw> (maintainer)
This commit is contained in:
Baptiste Daroussin 2010-08-12 18:31:18 +00:00
parent 1ef8bfe3e0
commit 398cd9b117
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=259140
2 changed files with 66 additions and 0 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= sslh
PORTVERSION= 1.7a
PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://www.rutschle.net/tech/
@ -19,6 +20,8 @@ USE_PERL5_BUILD= yes
MAN8= sslh.8
PLIST_FILES= sbin/sslh
USE_RC_SUBR= sslh
post-patch:
@${REINPLACE_CMD} -e 's|^PREFIX=/usr/local|PREFIX=${PREFIX}|g' ${WRKSRC}/Makefile

63
net/sslh/files/sslh.in Normal file
View File

@ -0,0 +1,63 @@
#!/bin/sh
# $FreeBSD$
#
# sslh startup script
#
# PROVIDE: sslh
# REQUIRE: login
# KEYWORD: shutdown
#
# Add the following to /etc/rc.conf[.local] to enable this service
#
# sslh_enable="YES"
#
# You can fine tune others variables too:
# sslh_fib="NONE"
# sslh_pidfile="/var/run/sslh.pid"
# sslh_ssltarget="localhost:443"
# sslh_sshtarget="localhost:22"
# sslh_sshtimeout="2"
# sslh_listening="0.0.0.0:8443"
# sslh_uid="nobody"
# sslh_flags=""
sslh_setfib() {
sysctl net.fibs >/dev/null 2>&1 || return 0
case "$sslh_fib" in
[Nn][Oo][Nn][Ee])
;;
*)
command="setfib -F ${sslh_fib} ${command}"
;;
esac
}
. /etc/rc.subr
name="sslh"
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/${name}"
start_precmd="sslh_setfib"
load_rc_config $name
sslh_enable=${sslh_enable:-"NO"}
sslh_fib=${sslh_fib:-"NONE"}
sslh_listening=${sslh_listening:-"0.0.0.0:443"}
sslh_sshtarget=${sslh_sshtarget:-"localhost:22"}
sslh_ssltarget=${sslh_ssltarget:-"localhost:8443"}
sslh_uid=${sslh_uid:-"nobody"}
sslh_sshtimeout=${sslh_sshtimeout:-"2"}
sslh_ssltarget=${sslh_ssltarget:-"localhost:8443"}
pidfile=${sslh_pidfile:-"/var/run/sslh.pid"}
command_args="-t ${sslh_sshtimeout} -p ${sslh_listening} \
-l ${sslh_ssltarget} -s ${sslh_sshtarget} -P ${pidfile} \
-u ${sslh_uid}"
run_rc_command "$1"