Revert "openssh: start init scripts on RUNLEVEL=boot"

This reverts commit 997ef7c3b9d48c62061fa194a75e5a5cb9c2d2d0.
This commit is contained in:
Stephan Raue 2011-09-12 19:26:59 +02:00
parent d2443b373f
commit b5bea18819

View File

@ -22,61 +22,55 @@
#
# runlevels: openelec, textmode
RSA1_KEY="/storage/.cache/ssh/ssh_host_key"
RSA2_KEY="/storage/.cache/ssh/ssh_host_rsa_key"
DSA2_KEY="/storage/.cache/ssh/ssh_host_dsa_key"
(
RSA1_KEY="/storage/.cache/ssh/ssh_host_key"
RSA2_KEY="/storage/.cache/ssh/ssh_host_rsa_key"
DSA2_KEY="/storage/.cache/ssh/ssh_host_dsa_key"
KEYGEN="/usr/bin/ssh-keygen"
SSHD="/usr/sbin/sshd"
KEYGEN="/usr/bin/ssh-keygen"
SSHD="/usr/sbin/sshd"
case $RUNLEVEL in
boot)
(
# Check for the SSH1 RSA key
if [ ! -f $RSA1_KEY ] ; then
progress "SSH: generating SSH1 RSA key"
# Check for the SSH1 RSA key
if [ ! -f $RSA1_KEY ] ; then
progress "SSH: generating SSH1 RSA key"
mkdir -p /storage/.cache/ssh
$KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null
chmod 600 $RSA1_KEY
fi
mkdir -p /storage/.cache/ssh
$KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null
chmod 600 $RSA1_KEY
fi
# Check for the SSH2 RSA key
if [ ! -f $RSA2_KEY ] ; then
progress "SSH: generating SSH2 RSA key"
# Check for the SSH2 RSA key
if [ ! -f $RSA2_KEY ] ; then
progress "SSH: generating SSH2 RSA key"
mkdir -p /storage/.cache/ssh
$KEYGEN -q -t rsa -f $RSA2_KEY -C '' -N '' >&/dev/null
chmod 600 $RSA2_KEY
fi
mkdir -p /storage/.cache/ssh
$KEYGEN -q -t rsa -f $RSA2_KEY -C '' -N '' >&/dev/null
chmod 600 $RSA2_KEY
fi
# Check for the SSH2 DSA key
if [ ! -f $DSA2_KEY ] ; then
progress "SSH: generating SSH2 DSA key"
# Check for the SSH2 DSA key
if [ ! -f $DSA2_KEY ] ; then
progress "SSH: generating SSH2 DSA key"
mkdir -p /storage/.cache/ssh
$KEYGEN -q -t dsa -f $DSA2_KEY -C '' -N '' >&/dev/null
chmod 600 $DSA2_KEY
fi
mkdir -p /storage/.cache/ssh
$KEYGEN -q -t dsa -f $DSA2_KEY -C '' -N '' >&/dev/null
chmod 600 $DSA2_KEY
fi
# Check for predifined known hosts file
if [ -f /etc/ssh/known_hosts -a ! -f $HOME/.ssh/known_hosts ] ; then
progress "SSH: setup predifined known hosts"
# Check for predifined known hosts file
if [ -f /etc/ssh/known_hosts -a ! -f $HOME/.ssh/known_hosts ] ; then
progress "SSH: setup predifined known hosts"
mkdir -p /$HOME/.ssh
cp /etc/ssh/known_hosts $HOME/.ssh
fi
mkdir -p /$HOME/.ssh
cp /etc/ssh/known_hosts $HOME/.ssh
fi
progress "Starting SSH Server"
progress "Starting SSH Server"
wait_for_network
wait_for_network
mkdir -p /var/empty
chmod -R 600 /var/empty
$SSHD
)&
;;
mkdir -p /var/empty
chmod -R 600 /var/empty
$SSHD
poweroff|reboot)
;;
esac
)&