Browse Source

scripts/InstallScripts/InstallPrawnOS.sh: only attempt to unmount if the device is mounted

This reduces unneeded noise to the console.

If there is problem, we already ignored anyway, because of `|| /bin/true`
Austin English 4 years ago
parent
commit
9680e986d7
1 changed files with 10 additions and 1 deletions
  1. 10 1
      scripts/InstallScripts/InstallPrawnOS.sh

+ 10 - 1
scripts/InstallScripts/InstallPrawnOS.sh

@@ -95,8 +95,17 @@ install() {
         esac
     done
 
-    umount ${TARGET}1 || /bin/true
+    # Only try to unmount if the device is mounted
+    # If it is, try anyway, the dd will (likely) take care of it anyway
+    if findmnt ${TARGET}1 > /dev/null
+    then
+        umount ${TARGET}1 || /bin/true
+    fi
+
+    if findmnt ${TARGET}2 > /dev/null
+    then
     umount ${TARGET}2 || /bin/true
+    fi
 
     if [[ $TARGET == "/dev/mmcblk2p" ]]
     then