summaryrefslogtreecommitdiff
path: root/scripts/install
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2010-07-27 19:43:42 -0700
committerBob Gilligan <gilligan@vyatta.com>2010-07-27 19:47:00 -0700
commit55838e499f21a5d91e6d8a8a3d81ff02ec0f725c (patch)
tree1e746e1edf3625d4d8dac835dfdbd54f97aad3b8 /scripts/install
parent365e36706c907e889d316627682c5c9765bc1834 (diff)
downloadvyatta-cfg-system-55838e499f21a5d91e6d8a8a3d81ff02ec0f725c.tar.gz
vyatta-cfg-system-55838e499f21a5d91e6d8a8a3d81ff02ec0f725c.zip
Bugfix 5929: Preserve SSH host keys during image installation.
(cherry picked from commit 71b716b7f5e5df1dd4ea6e8a16c7f987381cab8c)
Diffstat (limited to 'scripts/install')
-rwxr-xr-xscripts/install/install-image-existing15
1 files changed, 15 insertions, 0 deletions
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