summaryrefslogtreecommitdiff
path: root/scripts/install-system
diff options
context:
space:
mode:
authorRobert Bays <rbays@moresby.vyatta.com>2008-03-21 13:31:34 -0700
committerrbalocca <rbalocca@vyatta.com>2008-06-12 13:51:19 -0700
commit9fa993cfae190e0d1b654ec2f94757665f31c137 (patch)
tree12008732d2c292fcb31f1d6e2b76fd823bdf929d /scripts/install-system
parent41b590edb001c5eda6b71b54d1b77a79270387c5 (diff)
downloadvyatta-cfg-system-9fa993cfae190e0d1b654ec2f94757665f31c137.tar.gz
vyatta-cfg-system-9fa993cfae190e0d1b654ec2f94757665f31c137.zip
fix bug 3039
Diffstat (limited to 'scripts/install-system')
-rwxr-xr-xscripts/install-system48
1 files changed, 23 insertions, 25 deletions
diff --git a/scripts/install-system b/scripts/install-system
index 8f2be62b..79a87a63 100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -281,35 +281,33 @@ check_config_partition() {
mkdir -p /mnt/tmp
output=$(mount /dev/$lpart /mnt/tmp 2>&1)
if [ $? != 0 ]; then
- echo -e "Cannot mount /dev/$lpart"."\nPlease see $INSTALL_LOG for more details.\nExiting.."
echo -e "Cannot mount /dev/$lpart"."\nmount /dev/$ldrive$part /mnt/tmp\nExiting..." >> $INSTALL_LOG
echo "$output" >> $INSTALL_LOG
- exit 1
- fi
-
- # Look to see if there is a config partition there
- if [ -f /mnt/tmp/opt/vyatta/etc/config/.vyatta_config ] || [ -f /mnt/tmp/.vyatta_config ]; then
- response=''
- while [ -z "$response" ]
- do
- echo "/dev/$lpart has an old configuration directory!"
- echo -ne "Would you like me to save the data on it\nbefore I delete it? (Yes/No) [Yes]: "
- response=$(get_response "Yes" "Yes No Y N")
- if [ "$response" == "yes" ] || [ "$response" == "y" ]; then
- mkdir -p /mnt/config
- if [ -d /mnt/tmp/opt/vyatta/etc/config ]; then
- output=$(cp -pR /mnt/tmp/opt/vyatta/etc/config/* /mnt/config)
- else
- output=$(cp -pR /mnt/tmp/* /mnt/config)
- fi
- if [ -n "$output" ]; then
- echo -e "Warning: error in copying the old config partition.\nSee $INSTALL_LOG for more details."
- echo -e "Warning: error in copying the old config partition.\ncp -pR /mnt/tmp/* /mnt/config\n$output\n" >> $INSTALL_LOG
+ else
+ # Look to see if there is a config partition there
+ if [ -f /mnt/tmp/opt/vyatta/etc/config/.vyatta_config ] || [ -f /mnt/tmp/.vyatta_config ]; then
+ response=''
+ while [ -z "$response" ]
+ do
+ echo "/dev/$lpart has an old configuration directory!"
+ echo -ne "Would you like me to save the data on it\nbefore I delete it? (Yes/No) [Yes]: "
+ response=$(get_response "Yes" "Yes No Y N")
+ if [ "$response" == "yes" ] || [ "$response" == "y" ]; then
+ mkdir -p /mnt/config
+ if [ -d /mnt/tmp/opt/vyatta/etc/config ]; then
+ output=$(cp -pR /mnt/tmp/opt/vyatta/etc/config/* /mnt/config)
+ else
+ output=$(cp -pR /mnt/tmp/* /mnt/config)
+ fi
+ if [ -n "$output" ]; then
+ echo -e "Warning: error in copying the old config partition.\nSee $INSTALL_LOG for more details."
+ echo -e "Warning: error in copying the old config partition.\ncp -pR /mnt/tmp/* /mnt/config\n$output\n" >> $INSTALL_LOG
+ fi
fi
- fi
- done
+ done
+ fi
+ umount /mnt/tmp
fi
- umount /mnt/tmp
}
# Delete all existing partitions for an automated install