Created
November 28, 2019 13:41
-
-
Save mattintosh4/7aead65bddf5995f558ce0cbb67d4de1 to your computer and use it in GitHub Desktop.
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/bash | |
set -e | |
set -u | |
set -x | |
name="El Capitan" | |
tempfile=$(mktemp -u) | |
hdiutil create -size 8g -fs HFS+J -layout SPUD ${tempfile} | |
hdiutil attach ${tempfile}.dmg -noverify -nobrowse -mountpoint "/Volumes/Install OS X ${name}" | |
sudo "/Applications/Install OS X ${name}.app/Contents/Resources/createinstallmedia" --volume "/Volumes/Install OS X ${name}" --applicationpath "/Applications/Install OS X ${name}.app" --nointeraction | |
hdiutil detach "/Volumes/Install OS X ${name}" | |
hdiutil resize -size $(hdiutil resize -limits ${tempfile}.dmg | awk 'END { print $1 }')b ${tempfile}.dmg | |
hdiutil convert ${tempfile}.dmg -ov -format UDTO -o "Install OS X ${name}" | |
rm ${tempfile}.dmg | |
mv "Install OS X ${name}".{cdr,iso} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment