aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2010-08-13 02:31:18 +0800
committerbapt <bapt@FreeBSD.org>2010-08-13 02:31:18 +0800
commit48c621f23c3c35f390b31a0008c7c757a11a11de (patch)
treeb2ee8405aefde3073a594402c6011c73b5fec89c /net
parent57b75bc8cfdbf67d1104289baa396f1cb60d5fb2 (diff)
downloadfreebsd-ports-gnome-48c621f23c3c35f390b31a0008c7c757a11a11de.tar.gz
freebsd-ports-gnome-48c621f23c3c35f390b31a0008c7c757a11a11de.tar.zst
freebsd-ports-gnome-48c621f23c3c35f390b31a0008c7c757a11a11de.zip
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)
Diffstat (limited to 'net')
-rw-r--r--net/sslh/Makefile3
-rw-r--r--net/sslh/files/sslh.in63
2 files changed, 66 insertions, 0 deletions
diff --git a/net/sslh/Makefile b/net/sslh/Makefile
index e81160f763ed..cb17ddbcc163 100644
--- a/net/sslh/Makefile
+++ b/net/sslh/Makefile
@@ -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
diff --git a/net/sslh/files/sslh.in b/net/sslh/files/sslh.in
new file mode 100644
index 000000000000..5af38892522d
--- /dev/null
+++ b/net/sslh/files/sslh.in
@@ -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"