#! /bin/sh

# Holger Levsen, 2005-02-10

# 
# re-use previously created ssh_host_keys
#	this requieres a /backup-partition with lazyformat!
#
if [ -d /backup/secrets ] ; then
	cp -av /backup/secrets/ssh_host_*  /etc/ssh/
	/etc/init.d/ssh restart
else
	# 
	# preserve ssh_host_keys for reinstallation
	#
	if [ ! -d /backup/secrets ] ; then
	        mkdir -p /backup/secrets
		chmod 700 /backup/secrets
	fi
	cp -avu /etc/ssh/ssh_host_* /backup/secrets/
fi
