From e932796d83c87ea5af095e11f4fbbbffd0c31e10 Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu Date: Sun, 24 Dec 2017 20:40:05 +0200 Subject: [PATCH] Do not use dmg2img on macOS macOS is able to mount and attach .dmg file so no conversion to .img is required. --- bin/decrypt_fs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/decrypt_fs b/bin/decrypt_fs index 77fd22a..f903dba 100755 --- a/bin/decrypt_fs +++ b/bin/decrypt_fs @@ -28,6 +28,11 @@ else warn_if_error fi +if [[ $OSTYPE == darwin* ]]; then + info "macOS is able to attach and mount .dmg files. Not converting $decrypted to $img" + exit 0 +fi + part_num=$(dmg2img -l "$decrypted" | grep "disk image" | awk '{print $2}' | head -c 2) debug "Extracting partition $part_num in dmg file $decrypted to filesystem image file $img ..." debug "dmg2img -p $part_num -i $decrypted -o $img"