Posted on 06-17-2022 07:12 AM
I'm using this following script https://github.com/jamf/Jamf-Nation-Scripts/blob/master/FirefoxInstall.sh that is labeled in the top area of the script 'Only works on Intel system'.
Looks like the current Firefox macOS download is universal. Does anyone have a script this will download and install the current version of Firefox? or will simply removing from the script the 'IF' check for intel systems simply work????
here is the download link for macOS firefox when i copy the link from the mozilla firefox download page
Posted on 06-17-2022 07:20 AM
It looks like i might have found a post with the solution, so i'll test it out
https://community.jamf.com/t5/jamf-pro/latest-firefox-now-available-as-pkg/td-p/228259
Posted on 06-17-2022 07:51 AM
actually it looks like there is some issue with the if statement in this script https://github.com/jamf/Jamf-Nation-Scripts/blob/master/FirefoxInstall.sh and the script actually runs on M1 system. But the problem is is that it installs firefox version 98.02 and not the current version as of 6/17/2022 (which is something like 101).
So i've seen on both intel and M1 macs that his script runs on both but installs version 98.02 no matter how many times the script is executed.
I'm going to test this script now https://community.jamf.com/t5/jamf-pro/latest-firefox-now-available-as-pkg/td-p/228259
Posted on 06-17-2022 08:32 AM
Here's one I put together a while back.
https://gist.github.com/talkingmoose/b99a43948c4784631e9ad60eb714c776
It'll install and/or update Firefox. I've designed it to not install while Firefox is running and it should compare what's installed with what's available before doing anything.
Posted on 06-17-2022 09:32 AM
@talkingmoose so your script is good to go no matter if it's run on INTEL or M1 macs? I'm pretty sure the firefox installer is universal anyways.
Posted on 06-17-2022 10:09 AM
According to the System Information app, the version my script just downloaded is Universal.
Posted on 06-17-2022 01:03 PM
Installomator (https://github.com/Installomator/Installomator) is working for us on both Intel and Apple Silicon Macs.
Posted on 06-18-2022 02:18 PM
@talkingmoose in the script i see a couple of one liners like this = logresult "Downloaded DMG." "Failed to download DMG."
is this another way of writing an IF statement?
Posted on 06-19-2022 10:12 AM
@tcandela, that's a little function I put together a while back and keep reusing in a lot of my scripts where I want to write a log file for quick and easy access.
First, I define where the log is written:
# create log file in same directory as script
log="/Library/Logs/My Script.log"
Then I create a function named "logresult". It writes a timestamped message to the log file defined above.
function logresult() {
if [ $? = 0 ] ; then
/bin/date "+%Y-%m-%d %H:%M:%S $1" >> "$log"
else
/bin/date "+%Y-%m-%d %H:%M:%S $2" >> "$log"
fi
}
Usually, all I want to know is whether a command succeeded or failed. If I run $? immediately after any command it'll either return 0 (success) or something other than 0 like 1 (fail).
When I want to log "success" or "fail", I write immediately after the command:
logresult "Success" "Fail"
The positions of "Success" and "Fail" are like script parameters. "Success" = "$1" and "Fail" = "$2". If I needed more options I could write something like:
logresult "Yes" "No" "I don't know" "I don't care"
"Yes" = "$1"
"No" = "$2"
"I don't know" = "$3"
"I don't care" = "$4"
Putting it all together: