From 21031c67393d26a814298a8755d4bea43b0834de Mon Sep 17 00:00:00 2001 From: Bob Gilligan Date: Wed, 1 Oct 2008 17:58:47 -0700 Subject: Bugfix: 3727 In the case when we are using a pre-existing RAID group, warn the user of dire consequences before over-writing the disks. --- scripts/install-system | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/install-system b/scripts/install-system index 15a4285e..5543fecb 100644 --- a/scripts/install-system +++ b/scripts/install-system @@ -206,6 +206,24 @@ probe_drives () { } +warn_of_dire_consequences () { + # Give the user a requisite warning that we are about to nuke their drive + response='' + while [ -z $response ] + do + echo "This will destroy all data on /dev/$INSTALL_DRIVE." + echo -n "Continue? (Yes/No) [No]: " + response=$(get_response "No" "Yes No Y N") + + if [ "$response" == "no" ] || [ "$response" == "n" ]; then + echo "Ok then. Exiting..." + exit 1 + fi + done +} + + + check_for_old_raid () { # First, trigger construction of previously configured RAID groups echo -n "Looking for pre-existing RAID groups..." @@ -264,6 +282,9 @@ check_for_old_raid () { fi echo "Using RAID partition $INSTALL_DRIVE" + + warn_of_dire_consequences + ROOT_PARTITION=$INSTALL_DRIVE # make sure we aren't working on a mounted part @@ -997,19 +1018,7 @@ setup_method_auto() { fi done - # Give the user a requisite warning that we are about to nuke their drive - response='' - while [ -z $response ] - do - echo "This will destroy all data on /dev/$INSTALL_DRIVE." - echo -n "Continue? (Yes/No) [No]: " - response=$(get_response "No" "Yes No Y N") - - if [ "$response" == "no" ] || [ "$response" == "n" ]; then - echo "Ok then. Exiting..." - exit 1 - fi - done + warn_of_dire_consequences echo -- cgit v1.2.3