aboutsummaryrefslogtreecommitdiffstats
path: root/testing/sslh
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2020-03-07 01:47:06 +0100
committerJakub Jirutka <jakub@jirutka.cz>2020-03-07 02:11:19 +0100
commit67353329f011669ef97fa4cea83ad6b1c92fe0d0 (patch)
tree623e330939ff65198c8f5fb9c6f76e8c40394fe0 /testing/sslh
parent130e06710972dd17bcd77a948fbb3909d1ca2e79 (diff)
downloadaports-67353329f011669ef97fa4cea83ad6b1c92fe0d0.tar.bz2
aports-67353329f011669ef97fa4cea83ad6b1c92fe0d0.tar.xz
testing/sslh: rewrite init script and move config to /etc/sslh.conf
Diffstat (limited to 'testing/sslh')
-rw-r--r--testing/sslh/APKBUILD6
-rw-r--r--testing/sslh/sslh.confd14
-rw-r--r--testing/sslh/sslh.initd29
3 files changed, 22 insertions, 27 deletions
diff --git a/testing/sslh/APKBUILD b/testing/sslh/APKBUILD
index 6320867ce8..49b2e6e444 100644
--- a/testing/sslh/APKBUILD
+++ b/testing/sslh/APKBUILD
@@ -38,7 +38,7 @@ check() {
package() {
make DESTDIR="$pkgdir" PREFIX=/usr install
- install -D -m644 basic.cfg "$pkgdir/etc/$pkgname/$pkgname.conf"
+ install -D -m644 basic.cfg "$pkgdir/etc/$pkgname.conf"
install -D -m755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
install -D -m644 "$srcdir/$pkgname.confd" "$pkgdir/etc/conf.d/$pkgname"
}
@@ -68,5 +68,5 @@ sha512sums="eccaddd5a4299206f195c2f7a78840b2f76f8a0cf10a715b5c72f959ed5d3259fc5e
b82d3c799f0cdf183fe0545e1d2b4f142070112d7ec3594afd709608c4893c300122aa32026dd7f8e782eb3981bf85fc02f878e2613ddfe014f39bbb94fb441e fix-make-install.patch
5773ee1d91e099726b614dbe385f2668699d25029fc300b664411c6082e95d3f27df11b9b1489bee3444c81bf941b8db13b4d382343788e47408c593c4531816 fail2ban.patch
c5e3d6714c5588731c749feaed24a8d551d1fbdc527348209465b9416efe4713ff9715eb10867fea13fd5cbdf2ab41d52019fb93d4e5ead29e8fda47581598aa config.patch
-ba0a0fe8785ab9963d4dc11c39d6cbd41fe14d1e8f6d61eb0bf6eb2855e4f2de119b76f82894f3d52a91467ee83f4bd805d8eafc3c7da7b5a4f630cc4a241462 sslh.initd
-580114cef9356d66ec1e6c306837d44dc3098e8f3f805eda20c5d8f81f087bf295b25801ee64ee2bc667ce7324f510ff6f4fc7e222d1431ec3d4e82bbcfb160f sslh.confd"
+95e114f2973d063679d628249030c4ea189f43821c28ac44973d71ed4c7be8de0417cfdff4318aec24fac6aec1b06735d5480f6f7aa193fae2ab5a8feffecd36 sslh.initd
+19a5556eb5232428c506986d0bf42e678b0b21f40d2efe3679bce10807d73b0df2172c198c7153125e4b66039c3af5c776f0e66997be5fffa5200c9d13d179e1 sslh.confd"
diff --git a/testing/sslh/sslh.confd b/testing/sslh/sslh.confd
index 73d08d5f44..fca23f9c80 100644
--- a/testing/sslh/sslh.confd
+++ b/testing/sslh/sslh.confd
@@ -1,8 +1,10 @@
-# /etc/conf.d/sslh
+# Configuration for /etc/init.d/sslh
-# Options to sslh itself. See the sslh(1) man page.
-#DAEMON_OPTS=""
+# Path of the configuration file.
+#cfgfile="/etc/sslh.conf"
-# Multiplexing example
-# Port 44 can be used for ssh, http, and https. Drop privileges after starting.
-#DAEMON_OPTS="-p localhost:44 --ssh 127.0.0.1:22 --http 127.0.0.1:80 --ssl 127.0.0.1:443 --user nobody"
+# Additional options to pass to the sslh daemon. See sslh(1) man page.
+#command_args=""
+
+# Uncomment to run the sslh daemon under process supervisor.
+#supervisor=supervise-daemon
diff --git a/testing/sslh/sslh.initd b/testing/sslh/sslh.initd
index b75e96f2a3..46f9554c6c 100644
--- a/testing/sslh/sslh.initd
+++ b/testing/sslh/sslh.initd
@@ -1,21 +1,14 @@
#!/sbin/openrc-run
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-start() {
- ebegin "Starting ${SVCNAME}"
- start-stop-daemon --start \
- --pidfile /var/run/${SVCNAME}.pid \
- --exec /usr/sbin/sslh -- \
- ${DAEMON_OPTS} \
- --pidfile /var/run/${SVCNAME}.pid
- eend $?
-}
+: ${cfgfile:="/etc/sslh.conf"}
+: ${wait:=50} # milliseconds
-stop() {
- ebegin "Stopping ${SVCNAME}"
- start-stop-daemon --stop --quiet --retry 20 \
- --pidfile /var/run/${SVCNAME}.pid
- eend $?
-}
+description="Port multiplexer for SSH, HTTPS, OpenVPN etc."
+
+command="/usr/sbin/sslh"
+command_args="-F$cfgfile -f ${command_args:-$DAEMON_OPTS}"
+command_background="yes"
+pidfile="/run/$RC_SVCNAME.pid"
+start_stop_daemon_args="--wait $wait"
+
+required_files="$cfgfile"