aports/community/tinyssh/tinyssh.initd
Natanael Copa 7662bc3e73 community/tinyssh: fix #9550
only run tinysshd-keygen if /etc/tinyssh/sshkeys is missing
2018-10-11 16:37:57 +02:00

36 lines
802 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 #
supervisor=supervise-daemon
description="Small SSH server using NaCl (no dependency on OpenSSL)"
pidfile="/run/tinysshd.sd.pid"
supervise_daemon_args=""
daemon=/usr/sbin/tinysshd
keygen=$daemon-makekey
CONFDIR=${CONFDIR:-/etc/tinyssh}
keydir=${CONFDIR}/sshkeys
OPTIONS=${OPTIONS:-\-v -l}
PORT=${PORT:-22}
IP=${IP:-0.0.0.0}
command="tcpserver"
command_args="-HRDl0 ${IP} ${PORT} $daemon ${OPTIONS} $keydir"
proxy_env=/etc/profile.d/proxy.sh
depend() {
use net
after logger firewall
}
start_pre() {
if ! [ -d "$keydir" ]; then
checkpath --directory ${CONFDIR}
$keygen $keydir 2>/dev/null
fi
}