Forked from niw/download_macos_and_create_install_disk.sh
Created
June 13, 2021 15:39
-
-
Save zchee/c74cf028836e091992efadef50e9f448 to your computer and use it in GitHub Desktop.
A script to download macOS install image and create an install disk image
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
| #!/usr/bin/env bash | |
| set -e | |
| readonly INSTALL_APP_PATH="/Applications/Install macOS Mojave.app" | |
| readonly MAC_APP_STORE_ID="id1398502828" | |
| //readonly MAC_APP_STORE_ID="id1354523149" // macOS Mojave (Beta) | |
| if [[ -r "$INSTALL_APP_PATH/Contents/SharedSupport/InstallESD.dmg" ]]; then | |
| echo "Found the install app, create an install disk image." | |
| # Mojave install disk image requires about 7GB space. | |
| hdiutil create -o untitled.dmg -size 7G -layout SPUD -fs HFS+J && \ | |
| hdiutil attach untitled.dmg | |
| # Create an install disk image. | |
| sudo "$INSTALL_APP_PATH/Contents/Resources/createinstallmedia" \ | |
| --volume /Volumes/untitled \ | |
| --downloadassets | |
| else | |
| # Open Mac App Store to download macOS installer app. | |
| /usr/bin/open "macappstores://itunes.apple.com/app/$MAC_APP_STORE_ID" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment