Files
Arch-R/packages/network/dropbear/init.d/41_sshd
Stephan Raue 84b5dcd1b7 dropbear:
- include /etc/profile
2010-05-16 11:03:12 +02:00

55 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
################################################################################
# Copyright (C) 2009-2010 OpenELEC.tv
# http://www.openelec.tv
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
# start ssh server
#
# runlevels: openelec, textmode
. /etc/profile
(
# Check for the Dropbear RSA key
if [ ! -f /storage/.cache/dropbear/dropbear_rsa_host_key ] ; then
progress "SSH: generating rsa key"
$IONICE mkdir -p /storage/.cache/dropbear
dropbearkey -t rsa -f /storage/.cache/dropbear/dropbear_rsa_host_key > /dev/null 2>&1
fi
# Check for the Dropbear DSS key
if [ ! -f /storage/.cache/dropbear/dropbear_dss_host_key ] ; then
progress "SSH: generating dsa key"
$IONICE mkdir -p /storage/.cache/dropbear
dropbearkey -t dss -f /storage/.cache/dropbear/dropbear_dss_host_key > /dev/null 2>&1
fi
progress "Starting SSH Server"
$IONICE mkdir -p /var/log
$IONICE touch /var/log/lastlog
$IONICE touch /var/log/wtmp
dropbear -b /etc/issue -P /var/run/dropbear.pid
)&