From ba52c52c2e85228655eda97543663962cbcc8c05 Mon Sep 17 00:00:00 2001 From: wattsy74 <49881777+wattsy74@users.noreply.github.com> Date: Fri, 24 Sep 2021 14:50:42 +0100 Subject: [PATCH] Update Firefox.sh --- Firefox.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Firefox.sh b/Firefox.sh index bce0ff4..e3523c3 100644 --- a/Firefox.sh +++ b/Firefox.sh @@ -13,13 +13,14 @@ # # HISTORY # -# Version: 1.3 +# Version: 1.4 # -# - Joe Farage, 18.03.2015 -# - Chris Hansen, 14.05.2020 Some square brackets change to double square brackets -# - Martyn Watts, 24.05.2020 Removed Language Variables as they are not needed and results were inconsistent -# - Martyn Watts, 30.06.2021 Added dock icon for all users using dockutil (prerequisite) -# - Michael Tanner, 18.08.2021 Adapted for use with Mosyle +# - 1.0 Joe Farage, 18.03.2015 +# - 1.0.1 Chris Hansen, 14.05.2020 Some square brackets change to double square brackets +# - 1.1 Martyn Watts, 24.05.2020 Removed Language Variables as they are not needed and results were inconsistent +# - 1.2 Martyn Watts, 30.06.2021 Added dock icon for all users using dockutil (prerequisite) +# - 1.3 Michael Tanner, 18.08.2021 Adapted for use with Mosyle +# - 1.4 Martyn Watts, 24.09.2021 Added Check to see if dockutil is installed to make the script more resilient # #################################################################################################### # Script to download and install Firefox. @@ -83,11 +84,13 @@ if [ '`/usr/bin/uname -p`'="i386" -o '`/usr/bin/uname -p`'="x86_64" ]; then newlyinstalledver=`/usr/bin/defaults read /Applications/Firefox.app/Contents/Info CFBundleShortVersionString` if [[ "${latestver}" = "${newlyinstalledver}" ]]; then /bin/echo "`date`: SUCCESS: Firefox has been updated to version ${newlyinstalledver}" >> ${logfile} - /bin/echo "`date`: Creating Dock Icon." >> ${logfile} - #/usr/local/bin/dockutil --remove 'Firefox' --allhomes - /bin/sleep 3 - #/usr/local/bin/dockutil --add '/Applications/Firefox.app' --after 'Safari' --allhomes - # /Library/Application\ Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType hud -title "Firefox Installed" -description "Firefox has been updated." & + if [[ -e "/usr/local/bin/dockutil" ]]; then + /bin/echo "`date`: Creating Dock Icon." >> ${logfile} + /usr/local/bin/dockutil --remove 'Firefox' --allhomes + /bin/sleep 3 + /usr/local/bin/dockutil --add '/Applications/Firefox.app' --after 'Safari' --allhomes + fi + /bin/echo "--" >> ${logfile} else /bin/echo "`date`: ERROR: Firefox update unsuccessful, version remains at ${currentinstalledver}." >> ${logfile} /bin/echo "--" >> ${logfile} @@ -103,4 +106,4 @@ else /bin/echo "`date`: ERROR: This script is for Intel Macs only." >> ${logfile} fi echo "Command: DeterminateManualStep: 1" >> ${deplog} -exit 0 \ No newline at end of file +exit 0