Skip to content

Instantly share code, notes, and snippets.

@limtbk
limtbk / recovery.sh
Last active July 11, 2021 03:09 — forked from jonathantneal/recovery.sh
Create or update macOS Mojave Recovery Partition Without Reinstalling
#!/bin/sh
# Set the macOS installer path as a variable
MACOS_INSTALLER="/Applications/$(ls /Applications | grep "Install macOS")"
MOUNT_POINT="$MACOS_INSTALLER/Contents/SharedSupport"
echo "macOS installer is \"$MACOS_INSTALLER\""
# Set the target disk as a variable
TARGET=$(diskutil info "$(bless --info --getBoot)" | awk -F':' '/Volume Name/ { print $2 }' | sed -e 's/^[[:space:]]*//')
echo "Target disk is \"$TARGET\""
@magnusviri
magnusviri / recovery.sh
Last active March 23, 2022 08:23 — forked from brndnblck/recovery.sh
Create or update macOS Mojave Recovery Partition Without Reinstalling
#!/bin/sh
# Set the macOS installer path as a variable
MACOS_INSTALLER="/Applications/$(ls /Applications | grep "Install macOS")"
MOUNT_POINT="$MACOS_INSTALLER/Contents/SharedSupport"
# Find the latest pkg at https://swscan.apple.com/content/catalogs/others/index-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
DOWNLOAD_URL="http://swcdn.apple.com/content/downloads/24/46/061-41421-A_M34O0XGXUZ/vpexpha4aju1y04pz8ylxfm3mn1f543z94/macOSUpd10.14.6.RecoveryHDUpdate.pkg"
PACKAGE_NAME="macOSUpd10.14.6.RecoveryHDUpdate.pkg"