From 55838e499f21a5d91e6d8a8a3d81ff02ec0f725c Mon Sep 17 00:00:00 2001 From: Bob Gilligan Date: Tue, 27 Jul 2010 19:43:42 -0700 Subject: Bugfix 5929: Preserve SSH host keys during image installation. (cherry picked from commit 71b716b7f5e5df1dd4ea6e8a16c7f987381cab8c) --- scripts/install/install-image-existing | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing index e8f723a0..27d19f4d 100755 --- a/scripts/install/install-image-existing +++ b/scripts/install/install-image-existing @@ -167,6 +167,21 @@ if [ -f "$VYATTA_CFG_DIR/config.boot" ]; then done fi +if [ -d /etc/ssh ]; then + resp='' + while [ -z "$resp" ]; do + echo 'Would you like to save the SSH host keys from your ' + echo -n 'current configuration? (Yes/No) [Yes]: ' + resp=$(get_response "Yes" "Yes No Y N") + if [ "$resp" == 'yes' ] || [ "$resp" == 'y' ]; then + echo 'Copying SSH keys...' + ndir=${INST_ROOT}/etc/ssh + mkdir -p $ndir + cp -p /etc/ssh/ssh_host* $ndir + fi + done +fi + # postinst hook PI_SCRIPT=${INST_ROOT}${vyatta_sysconfdir}/install-image/postinst if [ -e "$PI_SCRIPT" ]; then -- cgit v1.2.3