#!/sbin/openrc-run # Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 description="A small SSH server with state-of-the-art cryptography" : ${TINYSSH_PORT:="22"} : ${TINYSSH_IP:="0.0.0.0"} : ${TINYSSH_CONFDIR:="/etc/tinyssh"} : ${TINYSSH_KEYDIR:="${TINYSSH_CONFDIR}/keys"} : ${TINYSSH_OPTS:="-l -v"} TINYSSHD="/usr/sbin/tinysshd" MAKEKEY="${TINYSSHD}-makekey" PRINTKEY="/usr/bin/tinysshd-printkey" name="TinySSH server" command="/usr/bin/tcpserver" command_args="-HRDl0 ${TINYSSH_IP} ${TINYSSH_PORT} ${TINYSSHD} ${TINYSSH_OPTS} ${TINYSSH_KEYDIR}" command_background=true pidfile="/run/${RC_SVCNAME}.pid" start_stop_daemon_args="${SSD_OPTS}" depend() { use net after logger } start_pre() { if [ "${RC_CMD}" != "restart" ]; then checkpath -d "${TINYSSH_CONFDIR}" if ! ${PRINTKEY} ${TINYSSH_KEYDIR} >/dev/null 2>&1; then ${MAKEKEY} ${TINYSSH_KEYDIR} || return 1 fi fi }