It's not clear to me why this was made. We'll ignore the question of why you would want an ISO (you can write a DMG direct to USB, and Jamf, DeployStudio, etc, require a PKG...), and move on to optimization.<p>You can skip a lot of the convert/copy/asr steps by just using the hdiutil -srcfolder command, targeted to the createinstallmedia DMG, in conjunction with your target format. (This can be reproduced in Disk Utility as well, by the way.) As far as I can tell, you need about 3 commands here, and not a 189 line bash program with functions.<p>As mentioned elsewhere, Disk Maker X is the way to go. Thanks for sharing your work though, even if it's a bit over-built.