Last active
February 10, 2020 23:46
-
-
Save makotom/059a0a6fbe635d815a5c8cc312ba9d91 to your computer and use it in GitHub Desktop.
Get Windows drivers for Mac
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
#!/bin/bash | |
SUCATALOG="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" | |
MODEL_ID="MacBookPro9,1" # MBP 15-inch Mid 2012, for example | |
curl -sJL $SUCATALOG | grep -e 'BootCampESD\.pkg' -e '\.dist' | while read line | |
do | |
if [[ $line == *BootCampESD.pkg* ]] | |
then | |
pkgUrl=$(echo $line | sed -e 's/\s*<\/\{0,1\}string>\s*//g') | |
read distURLDef | |
distUrl=$(echo $distURLDef | sed -e 's/\s*<\/\{0,1\}string>\s*//g') | |
if (curl -sJL $distUrl | grep "$MODEL_ID" > /dev/null) | |
then | |
echo "Matched: $pkgUrl" | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment