From 10183c9fc367dc3651a3947366e8dc02e69c3ad6 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Mon, 30 Jun 2008 22:05:02 +0200 Subject: [PATCH] mountdest.sh (RAID) aditional check to prevent overwriting source media --- src/install+setup/install/mountdest.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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 -- 2.39.2