From: Arne Fitzenreiter Date: Mon, 30 Jun 2008 20:05:02 +0000 (+0200) Subject: mountdest.sh (RAID) aditional check to prevent overwriting source media X-Git-Tag: v2.3-beta1~9 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=10183c9fc367dc3651a3947366e8dc02e69c3ad6 mountdest.sh (RAID) aditional check to prevent overwriting source media --- diff --git a/src/install+setup/install/mountdest.sh b/src/install+setup/install/mountdest.sh index 1810d8ef26..0d21bbdd6e 100644 --- a/src/install+setup/install/mountdest.sh +++ b/src/install+setup/install/mountdest.sh @@ -63,9 +63,16 @@ for DEVICE in $(kudzu -qps -t 30 -c HD -b RAID | grep device: | cut -d ' ' -f 2 continue else umount /harddisk 2> /dev/null - echo -n "$DEVICE" > /tmp/dest_device - echo "${DEVICE} - yes, it is our destination" - exit 2 + mount /dev/${DEVICE}1 /harddisk 2> /dev/null + if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then + umount /harddisk 2> /dev/null + echo "${DEVICE} is source drive - SKIP" + continue + else + echo -n "$DEVICE" > /tmp/dest_device + echo "${DEVICE} - yes, it is our destination" + exit 2 + fi fi done