diff --git a/clone/clone b/clone/clone index 03a1565..c361ef2 100755 --- a/clone/clone +++ b/clone/clone @@ -51,7 +51,7 @@ step1(){ mounted_partitions=$( cat /proc/mounts | awk '{print $1}' | grep "$DEV" ); # if nothing found -> next step - test -z "$mounted_partitions" && echo "<<< done" && step2; + ls ${DEV}2 > /dev/null 2>&1 || $( echo "<<< done" && step2 ); for mounted in $mounted_partitions; do @@ -137,6 +137,8 @@ step3(){ step4(){ echo -e "\n>>> [4] Mounting partition ${DEV}2"; + test ! -f ${DEV}2 && $( echo "<<< error: device ${DEV}2 does not exist" && exit ); + # [1] Mount device partition sudo mount ${DEV}2 /mnt || $( echo "<<< error: can't mount" && exit );