Install the latest version of Brave Browser

AdamCraig
Contributor III

Modified a script that does the same thing for chrome. But this script will download and install the latest version of Brave directly from their web site

#!/bin/sh

dmgfile="Brave-Broswer.dmg"
volname="Brave Browser"
logfile="/Library/LogsBraveInstallScript.log"

url='https://brave-browser-downloads.s3.brave.com/latest/Brave-Browser.dmg'


/bin/echo "--" >> ${logfile}
/bin/echo "`date`: Downloading latest version." >> ${logfile}
/usr/bin/curl -s -o /tmp/${dmgfile} ${url}
/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
/usr/bin/hdiutil attach /tmp/${dmgfile} -nobrowse -quiet
/bin/echo "`date`: Installing..." >> ${logfile}
ditto -rsrc "/Volumes/${volname}/Brave Browser.app" "/Applications/Brave Browser.app"
/bin/sleep 10
/bin/echo "`date`: Unmounting installer disk image." >> ${logfile}
/usr/bin/hdiutil detach $(/bin/df | /usr/bin/grep "${volname}" | awk '{print $1}') -quiet
/bin/sleep 10
/bin/echo "`date`: Deleting disk image." >> ${logfile}
/bin/rm /tmp/"${dmgfile}"

exit 0
1 REPLY 1

bradsschroeder
Moderator
Moderator

@strayer Thanks for tagging this with Jamf Nation. I think this would be better off just tagged with patch management as that is the primary function. Please let me know if you disagree with the removal of the Jamf Nation tag.