384384# ensure have required drive info tool
385385echo -n " [+] Looking for drive info tool..."
386386# `true` is so that a failure here doesn't cause entire script to exit prematurely
387- TOOL_BLOCKDEV=$( which blockdev 2> /dev/null) || true
387+ TOOL_BLOCKDEV=$( $SUDO which blockdev 2> /dev/null) || true
388388# `true` is so that a failure here doesn't cause entire script to exit prematurely
389389TOOL_IOREG=$( which ioreg 2> /dev/null) || true
390390if [[ -x " $TOOL_BLOCKDEV " ]]; then
@@ -402,7 +402,7 @@ echo " using $TOOL_DRIVE_INFO"
402402# ensure have required drive listing tool
403403echo -n " [+] Looking for drive listing tool..."
404404# `true` is so that a failure here doesn't cause entire script to exit prematurely
405- TOOL_BLOCKDEV=$( which blockdev 2> /dev/null) || true
405+ TOOL_BLOCKDEV=$( $SUDO which blockdev 2> /dev/null) || true
406406# `true` is so that a failure here doesn't cause entire script to exit prematurely
407407TOOL_DISKUTIL=$( which diskutil 2> /dev/null) || true
408408if [[ -x " $TOOL_BLOCKDEV " ]]; then
@@ -420,7 +420,7 @@ echo " using $TOOL_DRIVE_LISTING"
420420# ensure have required drive summary tool
421421echo -n " [+] Looking for drive summary tool..."
422422# `true` is so that a failure here doesn't cause entire script to exit prematurely
423- TOOL_BLKID=$( which blkid 2> /dev/null) || true
423+ TOOL_BLKID=$( $SUDO which blkid 2> /dev/null) || true
424424if [[ -x " $TOOL_BLKID " ]]; then
425425 TOOL_DRIVE_SUMMARY=$TOOL_BLKID
426426 echo " using $TOOL_DRIVE_SUMMARY "
433433# ensure have required unmount tool
434434echo -n " [+] Looking for unmount tool..."
435435# `true` is so that a failure here doesn't cause entire script to exit prematurely
436- TOOL_UMOUNT=$( which umount 2> /dev/null) || true
436+ TOOL_UMOUNT=$( $SUDO which umount 2> /dev/null) || true
437437# `true` is so that a failure here doesn't cause entire script to exit prematurely
438- TOOL_DISKUTIL=$( which diskutil 2> /dev/null) || true
438+ TOOL_DISKUTIL=$( $SUDO which diskutil 2> /dev/null) || true
439439# prefer 'diskutil' if available, as it's required on macOS (even if 'umount' is present)
440440if [[ -x " $TOOL_DISKUTIL " ]]; then
441441 TOOL_UNMOUNT=$TOOL_DISKUTIL
@@ -452,9 +452,9 @@ echo " using $TOOL_UNMOUNT"
452452# ensure have required UDF tool
453453echo -n " [+] Looking for UDF tool..."
454454# `true` is so that a failure here doesn't cause entire script to exit prematurely
455- TOOL_MKUDFFS=$( which mkudffs 2> /dev/null) || true
455+ TOOL_MKUDFFS=$( $SUDO which mkudffs 2> /dev/null) || true
456456# `true` is so that a failure here doesn't cause entire script to exit prematurely
457- TOOL_NEWFS_UDF=$( which newfs_udf 2> /dev/null) || true
457+ TOOL_NEWFS_UDF=$( $SUDO which newfs_udf 2> /dev/null) || true
458458if [[ -x " $TOOL_MKUDFFS " ]]; then
459459 TOOL_UDF=$TOOL_MKUDFFS
460460elif [[ -x " $TOOL_NEWFS_UDF " ]]; then
0 commit comments