Skip to content

Instantly share code, notes, and snippets.

@salmanmorshed
Created October 31, 2015 12:02
Show Gist options
  • Save salmanmorshed/15065d96b96da92c32a1 to your computer and use it in GitHub Desktop.
Save salmanmorshed/15065d96b96da92c32a1 to your computer and use it in GitHub Desktop.
Execute script inside the directory containing Nvidia Web Driver installer to create a patched copy
#!/bin/bash
# =========================================================================
# Patches Nvidia Web Driver installers for installing on non-MacPro devices
# By: Md. Salman Morshed - [email protected]
# =========================================================================
PKG_FILE="$(ls | grep WebDriver | head -1)"
TMP_DIR="$PKG_FILE.temp"
echo -n "Extracting installer package..."
pkgutil --expand "$PKG_FILE" "$TMP_DIR"
echo " [DONE]"
echo -n "Patching Distribution file..."
awk -F, '/system.sysctl/{print "\t\t\treturn true;"}1' "$TMP_DIR/Distribution" > "$TMP_DIR/new_dist"
rm "$TMP_DIR/Distribution"
mv "$TMP_DIR/new_dist" "$TMP_DIR/Distribution"
echo " [DONE]"
echo -n "Rebuilding installer package..."
pkgutil --flatten "$TMP_DIR" "(Patched) $PKG_FILE"
echo " [DONE]"
echo -n "Cleaning up..."
rm -rf "$TMP_DIR"
echo " [DONE]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment