mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
openssh: start init scripts on RUNLEVEL=boot
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
8569249f92
commit
997ef7c3b9
@ -22,55 +22,61 @@
|
||||
#
|
||||
# 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"
|
||||
|
||||
# Check for the SSH1 RSA key
|
||||
if [ ! -f $RSA1_KEY ] ; then
|
||||
progress "SSH: generating SSH1 RSA key"
|
||||
case $RUNLEVEL in
|
||||
boot)
|
||||
(
|
||||
# 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user