[fix] fixed when cannot mount ${DEV}2

This commit is contained in:
xdrm-brackets 2017-07-22 16:57:26 +02:00
parent 6d290df9f2
commit b5fd1196ed
1 changed files with 3 additions and 1 deletions

View File

@ -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 );