Created
May 24, 2013 18:04
-
-
Save triti/5645377 to your computer and use it in GitHub Desktop.
Absolute Manage install script for Adobe Flash Player Plugin on OS X
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 | |
SCRIPT="${0##*/}" | |
INSTALLPKG="${0%/*}/Install Adobe Flash Player.pkg" | |
MMSCFGDIR="/Library/Application Support/Macromedia" | |
MMSCFG="$MMSCFGDIR/mms.cfg" | |
# Print a message to the system log | |
# Optionally exit with specified status code | |
function dlog () { | |
/usr/bin/logger -s -t "$SCRIPT" "$1" | |
if [[ -n "$2" ]]; then | |
exit "$2" | |
fi | |
} | |
# Create a config file and directory with specified options | |
function mmscfg () { | |
/bin/mkdir -p "$MMSCFGDIR" && \ | |
printf "AutoUpdateDisable=%s\nSilentAutoUpdateEnable=%s\n" \ | |
"$1" "$2" > "$MMSCFG" | |
} | |
# --------------------------------------------------------------------------- | |
# Parse update options | |
case $1 in | |
--update|--updates ) | |
case $2 in | |
reset|delete|default ) UPDATECHOICE=0 ;; | |
allow|auto*|silent ) UPDATECHOICE=1 ;; | |
notify|noisy ) UPDATECHOICE=2 ;; | |
never|disable ) UPDATECHOICE=3 ;; | |
esac ;; | |
esac | |
# Install Flash Player and exit if unsuccessful | |
/usr/sbin/installer -pkg "$INSTALLPKG" -target / || dlog "ERROR Installer exited with status $?" -1 | |
dlog "Update choice = $UPDATECHOICE" | |
# Set update options | |
case "$UPDATECHOICE" in | |
0 ) /bin/rm -rf "$MMSCFG" ;; | |
1 ) mmscfg 0 1 ;; | |
2 ) mmscfg 0 0 ;; | |
3 ) mmscfg 1 0 ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script has been updated to work with the new .pkg installer from Adobe.