#!/bin/sh
#
# ssh_reset
# deletes the ssh host keys
#
##########################################################################
#
# (C) 2011 SUSE Linux Products GmbH, Nuremberg, Germany
# Author: Fabian Herschel (fabian.herschel@suse.com)
#
##########################################################################
#
# 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
# of the License, 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 this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#
##########################################################################
#

ssh_base="/etc/ssh/ssh_host_"
ssh_reset=0

usage()
{
	echo "ssh_reset --help | --ssh_reset"
	exit 0
}

delete_files()
{
   files="$*"
   if [ -n "$files" ]
   then
	rm -I $files
   fi
}

while [ $# -gt 0 ]
do
	case "$1" in
		--help | -h ) usage
			;;
		--ssh_reset )
			ssh_reset=1
			;;
		--version )
			echo 0.1
			exit 1
			;;
	esac
	shift
done

if [ $ssh_reset -eq 1 ]
then
        for file in ${ssh_base}*
        do
		delete_files "$file"
	done
else
	usage
fi

