Skip to content

Instantly share code, notes, and snippets.

@matthewbodaly
Created August 31, 2016 21:06
Show Gist options
  • Save matthewbodaly/4abf7e82787555494a830459b8ed4d40 to your computer and use it in GitHub Desktop.
Save matthewbodaly/4abf7e82787555494a830459b8ed4d40 to your computer and use it in GitHub Desktop.
Your FUNERAL
#!/bin/bash
# your funeral
LOCAL_INSTALL_MANAGER="/Applications/Utilities/Adobe Flash Player Install Manager.app/Contents/MacOS/Adobe Flash Player Install Manager"
DOWNLOAD_URL="https://fpdownload.macromedia.com/get/flashplayer/current/support/uninstall_flash_player_osx.dmg"
DMG_NAME=$(printf "%s" "$DOWNLOAD_URL" | sed 's@.*/@@')
LOCAL_DMG_PATH="/tmp/$DMG_NAME"
LOCAL_VOLUME_NAME="Flash Player"
localFlashVersion=$(/usr/bin/defaults read "/Library/Internet Plug-Ins/Flash Player.plugin/Contents/version" CFBundleShortVersionString)
if [ "${localFlashVersion}" ]; then
if [ -f "$LOCAL_INSTALL_MANAGER" ]; then
flashInstallManager="$LOCAL_INSTALL_MANAGER"
"$flashInstallManager" -uninstall
else
/usr/bin/curl -k --retry 3 --silent -o "$LOCAL_DMG_PATH" "$DOWNLOAD_URL"
/usr/bin/hdiutil attach "$LOCAL_DMG_PATH" -nobrowse -quiet
flashInstallManager="/Volumes/$LOCAL_VOLUME_NAME/Adobe Flash Player Uninstaller.app/Contents/MacOS/Adobe Flash Player Install Manager"
"$flashInstallManager" -uninstall
/usr/bin/hdiutil detach "/Volumes/$LOCAL_VOLUME_NAME"
/bin/rm "$LOCAL_DMG_PATH"
fi
else
printf "Adobe Flash not found."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment