2009-12-29 01:24:26 +01:00
|
|
|
#!/sbin/runscript
|
|
|
|
# Copyright 1999-2004 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-misc/dropbear/files/dropbear.init.d,v 1.2 2004/07/14 23:57:35 agriffis Exp $
|
|
|
|
|
|
|
|
depend() {
|
2012-05-20 20:39:43 +02:00
|
|
|
use logger dns
|
|
|
|
need net
|
2009-12-29 01:24:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
check_config() {
|
2012-05-20 20:39:43 +02:00
|
|
|
if [ ! -e /etc/dropbear/ ] ; then
|
|
|
|
mkdir /etc/dropbear/
|
|
|
|
fi
|
|
|
|
if [ ! -e /etc/dropbear/dropbear_dss_host_key ] ; then
|
|
|
|
einfo "Generating DSS-Hostkey..."
|
|
|
|
/usr/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
|
|
|
|
fi
|
|
|
|
if [ ! -e /etc/dropbear/dropbear_rsa_host_key ] ; then
|
|
|
|
einfo "Generating RSA-Hostkey..."
|
|
|
|
/usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
|
|
|
|
fi
|
2009-12-29 01:24:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
2012-05-20 20:39:43 +02:00
|
|
|
check_config || return 1
|
|
|
|
ebegin "Starting dropbear"
|
|
|
|
/usr/sbin/dropbear ${DROPBEAR_OPTS}
|
|
|
|
eend $?
|
2009-12-29 01:24:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2012-05-20 20:39:43 +02:00
|
|
|
ebegin "Stopping dropbear"
|
|
|
|
start-stop-daemon --stop --pidfile /run/dropbear.pid
|
|
|
|
eend $?
|
2009-12-29 01:24:26 +01:00
|
|
|
}
|