openssh: rework init script

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2013-01-23 23:06:54 +01:00
parent 78f45423e5
commit de28c2e71f

View File

@ -22,8 +22,17 @@
#
# runlevels: openelec, textmode
if [ -f /storage/.cache/openelec/sshd.conf ]; then
. /storage/.cache/openelec/sshd.conf
if [ -f /etc/sshd.conf ]; then
. /etc/sshd.conf
elif [ -f /storage/.config/sshd.conf ]; then
. /storage/.config/sshd.conf
fi
# Check if password authentication is disabled
OPTIONS=""
if [ "$SSHD_DISABLE_PW_AUTH" == "true" ] ; then
OPTIONS="-o 'PasswordAuthentication no'"
fi
RSA1_KEY="/storage/.cache/ssh/ssh_host_key"
@ -36,11 +45,7 @@
HOME="/storage"
(
if [ -f /etc/ssh.conf ]; then
. /etc/ssh.conf
fi
if [ "$SSH" = yes -o -f /storage/.config/ssh_enable -o "$SSHD_START" == "true" ]; then
if [ "$SSH" = "yes" -o "$SSHD_START" = "true" ]; then
# Check for the SSH1 RSA key
if [ ! -s $RSA1_KEY ] ; then
@ -81,12 +86,6 @@
cp /etc/ssh/known_hosts $HOME/.ssh
fi
# Check if password authentication is disabled
OPTIONS=""
if [ "$SSHD_DISABLE_PW_AUTH" == "true" ] ; then
OPTIONS="-o 'PasswordAuthentication no'"
fi
progress "Starting SSH Server"
mkdir -p /var/empty