mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-09-21 05:31:25 +02:00
ucspi-tcp6 is an obsolete package that conflicts with abuild. In order for tinysshd to keep working, we make it use s6-networking's s6-tcpserver instead of ucspi-tcp6's tcpserver. This adds a few dependencies, because s6-networking actually uses dynamic libraries whereas ucspi-tcp6 bundles everything in. This commit also removes the use of supervise-daemon, which mangles server command lines and does not bring any real supervision value.
31 lines
763 B
Plaintext
31 lines
763 B
Plaintext
#!/sbin/openrc-run
|
|
# Alpine Linux init.d for TinySSH
|
|
# Copyright 2017 Stuart Cardall (https://github.com/itoffshore)
|
|
# Distributed under the terms of the GNU General Public License, v2 or later #
|
|
# Modified by Laurent Bercot <ska-devel@skarnet.org> 2021-12-07
|
|
|
|
OPTIONS=${OPTIONS:-\-v -l}
|
|
PORT=${PORT:-22}
|
|
IP=${IP:-0.0.0.0}
|
|
CONFDIR=${CONFDIR:-/etc/tinyssh}
|
|
keydir=${CONFDIR}/sshkeys
|
|
|
|
depend() {
|
|
use net
|
|
after logger firewall
|
|
}
|
|
|
|
name=tinysshd
|
|
description="Small SSH server using libsodium (no dependency on OpenSSL)"
|
|
command="s6-tcpserver"
|
|
command_args="${IP} ${PORT} $name ${OPTIONS} $keydir"
|
|
command_background=true
|
|
pidfile=/var/run/tinysshd.pid
|
|
|
|
start_pre() {
|
|
if ! [ -d "$keydir" ]; then
|
|
checkpath -D ${CONFDIR}
|
|
tinysshd-makekey $keydir 2>/dev/null
|
|
fi
|
|
}
|