Created
July 20, 2019 23:42
-
-
Save oemden/18f1a38e47403ade49c9d3eaa02c9144 to your computer and use it in GitHub Desktop.
[Convert dmg to iso]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# oem @ oemden dot com | |
## Convert dmg to iso - need $1 as dmg file. Will basically save .iso in same place as input .dmg | |
if [[ ! "${1}" ]] ; then | |
echo "I need a dmg file as input ! Exiting" | |
exit 1 | |
fi | |
THISDIR=$(/usr/bin/dirname ${1}) | |
DISKNAME=$( basename "${1}" | sed 's/.dmg//g') | |
echo "Converting the disk image ${DISKNAME} to an ISO ..." | |
hdiutil convert "${1}" -format UDTO -o "${THISDIR}/${DISKNAME}" | |
mv "${THISDIR}/${DISKNAME}".cdr "${THISDIR}/${DISKNAME}".iso | |
open "${THISDIR}" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment