#!/bin/sh
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Copyright (C) 2008 linwizard.sourceforge.net

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

einfo "Starting dropbear.."
/usr/sbin/dropbear \
	-d /etc/dropbear/dropbear_dss_host_key \
	-r /etc/dropbear/dropbear_rsa_host_key
