Im hoping someone will be able to help me. I feel like i am doing something wrong or missing something blatantly obvious.
I have a script that will download and install the latest version of Google Chrome. When its run as a Self Service Item the policy will fail but if the script is run locally on the client it runs with no issues..
Any help will be much appreciated.
#!/bin/sh
dmgfile="googlechrome.dmg"
volname="Google Chrome"
LOG=/Library/Logs/GoogleChrome_Update/Install.log
url='https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg'
echo "<-------------------START------------------->" 1>> $LOG
date 1>> $LOG
echo "`date`: Downloading latest version." >> $LOG 2>&1
curl --output /tmp/"$dmgfile" "$url"
echo "`date`: Mounting installer disk image." >> $LOG 2>&1
hdiutil attach /tmp/"$dmgfile" -nobrowse -noverify -noautoopen
echo "`date`: Installing..." >> $LOG 2>&1
ditto -rsrc "/Volumes/$volname/Google Chrome.app" "/Applications/Google Chrome.app"
sleep 5
echo "`date`: Unmounting installer disk image." >> $LOG 2>&1
hdiutil detach $(/bin/df | grep "$volname" | awk '{print $1}') -quiet
sleep 5
echo "`date`: Deleting disk image." >> $LOG 2>&1
rm /tmp/"$dmgfile"
date 1>> $LOG
echo "<-------------------End------------------->" 1>> $LOG
exit 0