I'm trying to get my Flash update script to work again, after Adobe changed some things around early this year and it broke. I have pulled some updated information from other posts, and now have the script downloading the updated file correctly. Where I run into trouble is the actual mounting of the temporary DMG and running the install. It simply doesn't do anything... Below is the script that I'm using:
#!/bin/sh
# This script downloads and installs the latest Flash player for compatible Macs
# Determine OS version
osvers=$(sw_vers -productVersion | awk -F. '{print $2}')
# Determine current major version of Adobe Flash for use
# with the fileURL variable
flash_major_version=`/usr/bin/curl --connect-timeout 8 --max-time 8 -sf "http://fpdownload2.macromedia.com/get/flashplayer/update/current/xml/version_en_mac_pl.xml" 2>/dev/null | xmllint --format - 2>/dev/null | awk -F'"' '/<update version/{print $2}' | sed 's/,/./g'`
# Specify the complete address of the Adobe Flash Player
# disk image
fileURL="https://fpdownload.adobe.com/get/flashplayer/pdc/"$flash_major_version"/install_flash_player_osx.dmg"
# Specify name of downloaded disk image
flash_dmg="/tmp/flash.dmg"
# Download the latest Adobe Flash Player software disk image
/usr/bin/curl --output "$flash_dmg" "$fileURL"
# Specify a /tmp/flashplayer.XXXX mountpoint for the disk image
TMPMOUNT=`/usr/bin/mktemp -d /tmp/flashplayer.XXXX`
# Mount the latest Flash Player disk image to /tmp/flashplayer.XXXX mountpoint
hdiutil attach "$flash_dmg" -mountpoint "$TMPMOUNT" -nobrowse -noverify -noautoopen
# Install Adobe Flash Player from the installer package stored inside the disk image
/usr/sbin/installer -pkg /Volumes/Flash Player/Install Adobe Flash Player.app/Contents/Resources/Adobe Flash Player.pkg -target / > /dev/null
# Clean-up
# Unmount the Flash Player disk image from /tmp/flashplayer.XXXX
/usr/bin/hdiutil detach "$TMPMOUNT"
# Remove the /tmp/flashplayer.XXXX mountpoint
/bin/rm -rf "$TMPMOUNT"
# Remove the downloaded disk image
/bin/rm -rf "$flash_dmg"
fi
exit 0
I am not very well versed in scripting, so I'm doing this by trial and error. The command that isn't doing anything is the /user/sbin/installer line. Am I pointing it at the wrong location? If I look in disk management, I do see a Flash Player volume mounted from /private/tmp/flashplayer.VpVO, and if I "Show in Finder", I see the "Install Adobe Flash Player.app"... but when it runs, I just get... nothing.