From de28c2e71fa322b53f96b9c5312e54a0cf43865b Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Wed, 23 Jan 2013 23:06:54 +0100 Subject: [PATCH] openssh: rework init script Signed-off-by: Stephan Raue --- packages/network/openssh/init.d/51_sshd | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/packages/network/openssh/init.d/51_sshd b/packages/network/openssh/init.d/51_sshd index 64d0e41863..1b2c4eecfa 100644 --- a/packages/network/openssh/init.d/51_sshd +++ b/packages/network/openssh/init.d/51_sshd @@ -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