384
384
# ensure have required drive info tool
385
385
echo -n " [+] Looking for drive info tool..."
386
386
# `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
388
388
# `true` is so that a failure here doesn't cause entire script to exit prematurely
389
389
TOOL_IOREG=$( which ioreg 2> /dev/null) || true
390
390
if [[ -x " $TOOL_BLOCKDEV " ]]; then
@@ -402,7 +402,7 @@ echo " using $TOOL_DRIVE_INFO"
402
402
# ensure have required drive listing tool
403
403
echo -n " [+] Looking for drive listing tool..."
404
404
# `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
406
406
# `true` is so that a failure here doesn't cause entire script to exit prematurely
407
407
TOOL_DISKUTIL=$( which diskutil 2> /dev/null) || true
408
408
if [[ -x " $TOOL_BLOCKDEV " ]]; then
@@ -420,7 +420,7 @@ echo " using $TOOL_DRIVE_LISTING"
420
420
# ensure have required drive summary tool
421
421
echo -n " [+] Looking for drive summary tool..."
422
422
# `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
424
424
if [[ -x " $TOOL_BLKID " ]]; then
425
425
TOOL_DRIVE_SUMMARY=$TOOL_BLKID
426
426
echo " using $TOOL_DRIVE_SUMMARY "
433
433
# ensure have required unmount tool
434
434
echo -n " [+] Looking for unmount tool..."
435
435
# `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
437
437
# `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
439
439
# prefer 'diskutil' if available, as it's required on macOS (even if 'umount' is present)
440
440
if [[ -x " $TOOL_DISKUTIL " ]]; then
441
441
TOOL_UNMOUNT=$TOOL_DISKUTIL
@@ -452,9 +452,9 @@ echo " using $TOOL_UNMOUNT"
452
452
# ensure have required UDF tool
453
453
echo -n " [+] Looking for UDF tool..."
454
454
# `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
456
456
# `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
458
458
if [[ -x " $TOOL_MKUDFFS " ]]; then
459
459
TOOL_UDF=$TOOL_MKUDFFS
460
460
elif [[ -x " $TOOL_NEWFS_UDF " ]]; then
0 commit comments