Last active
September 22, 2016 20:10
-
-
Save thewellington/4452ca7d9adf66b2856e to your computer and use it in GitHub Desktop.
Create OS X Boot Disk
This file contains 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 | |
# | |
# | |
# create boot disks from OSX Installers | |
# | |
# This script makes the following assumptions when creating a bootable USB drive. | |
# 1. You have downloaded the installer from the AppStore, and it is sitting in | |
# the /Applications directory (the default location.) | |
# 2. you have a freshly formatted USB drive with the following characteristics: | |
# - at least 8GB in size | |
# - Formatted "Mac OS Extended (Journaled)" | |
# - GUID Partition Map | |
# - the volume is titled "Untitled" | |
# | |
# Execute using the following command: | |
# create_osx_boot.sh < Mavericks | Yosemite | ElCapitan | Sierra > | |
# | |
# v.2016-09-22 by bill@wellingtonnet.net | |
######################################################################################## | |
# set some variables | |
if [[ "$1" = "Sierra" ]]; then | |
APPLICATION_PATH='/Applications/Install macOS Sierra.app' | |
elif [[ "$1" = "ElCapitan" ]]; then | |
APPLICATION_PATH='/Applications/Install OS X El Capitan.app' | |
elif [[ "$1" = "Yosemite" ]]; then | |
APPLICATION_PATH='/Applications/Install OS X Yosemite.app' | |
elif [[ "$1" = "Mavericks" ]]; then | |
APPLICATION_PATH='/Applications/Install OS X Mavericks.app' | |
else | |
echo "sorry: no option available for ${1}" | |
exit | |
fi | |
INSTALLER_PATH="$APPLICATION_PATH/Contents/Resources/createinstallmedia" | |
DESTINATION_VOL='/Volumes/Untitled' | |
# ok let's get to work | |
sudo "${INSTALLER_PATH}" --volume "${DESTINATION_VOL}" --applicationpath "${APPLICATION_PATH}" --nointeraction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment