[fix] fixed when cannot mount ${DEV}2
This commit is contained in:
parent
6d290df9f2
commit
b5fd1196ed
|
@ -51,7 +51,7 @@ step1(){
|
||||||
mounted_partitions=$( cat /proc/mounts | awk '{print $1}' | grep "$DEV" );
|
mounted_partitions=$( cat /proc/mounts | awk '{print $1}' | grep "$DEV" );
|
||||||
|
|
||||||
# if nothing found -> next step
|
# 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
|
for mounted in $mounted_partitions; do
|
||||||
|
|
||||||
|
@ -137,6 +137,8 @@ step3(){
|
||||||
step4(){
|
step4(){
|
||||||
echo -e "\n>>> [4] Mounting partition ${DEV}2";
|
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
|
# [1] Mount device partition
|
||||||
sudo mount ${DEV}2 /mnt || $( echo "<<< error: can't mount" && exit );
|
sudo mount ${DEV}2 /mnt || $( echo "<<< error: can't mount" && exit );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue