mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
firefoxpkg_intl
Trying to determine the language of the user, and then installing that localized version, instead of en_US. But it will fall back to en_US if something goes wrong.
This commit is contained in:
24
fragments/labels/firefoxpkg_intl.sh
Normal file
24
fragments/labels/firefoxpkg_intl.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
firefoxpkg_intl)
|
||||
# This label will try to figure out the selected language of the user,
|
||||
# and install corrosponding version of Firefox ESR
|
||||
name="Firefox"
|
||||
type="pkg"
|
||||
userLanguage=$(runAsUser defaults read .GlobalPreferences AppleLocale)
|
||||
printlog "Found language $userLanguage to be used for Firefox." WARN
|
||||
if ! curl -fs "https://ftp.mozilla.org/pub/firefox/releases/latest/README.txt" | grep -o "=$userLanguage"; then
|
||||
userLanguage=$(echo $userLanguage | cut -c 1-2)
|
||||
if ! curl -fs "https://ftp.mozilla.org/pub/firefox/releases/latest/README.txt" | grep "=$userLanguage"; then
|
||||
userLanguage="en_US"
|
||||
fi
|
||||
fi
|
||||
printlog "Using language $userLanguage for download." WARN
|
||||
downloadURL="https://download.mozilla.org/?product=firefox-pkg-latest-ssl&os=osx&lang=$userLanguage"
|
||||
# https://download.mozilla.org/?product=firefox-pkg-latest-ssl&os=osx&lang=en-US
|
||||
if ! curl -sfL --output /dev/null -r 0-0 "$downloadURL" ; then
|
||||
printlog "Download not found for that language. Using en-US" WARN
|
||||
downloadURL="https://download.mozilla.org/?product=firefox-pkg-latest-ssl&os=osx&lang=en-US"
|
||||
fi
|
||||
appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location | cut -d "/" -f7)
|
||||
expectedTeamID="43AQ936H96"
|
||||
blockingProcesses=( firefox )
|
||||
;;
|
||||
Reference in New Issue
Block a user