mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-31 22:04:22 +01:00
Code update and fix for firefox_intl
Fixed $userLanguage to use dash separator instead of underscore, since that is what is used in the $releaseURL.
This commit is contained in:
@@ -3,21 +3,23 @@ firefox_intl)
|
|||||||
# and install corrosponding version of Firefox
|
# and install corrosponding version of Firefox
|
||||||
name="Firefox"
|
name="Firefox"
|
||||||
type="dmg"
|
type="dmg"
|
||||||
userLanguage=$(runAsUser defaults read .GlobalPreferences AppleLocale)
|
userLanguage=$(runAsUser defaults read .GlobalPreferences AppleLocale | tr '_' '-')
|
||||||
printlog "Found language $userLanguage to be used for Firefox."
|
printlog "Found language $userLanguage to be used for $name."
|
||||||
if ! curl -fs "https://ftp.mozilla.org/pub/firefox/releases/latest/README.txt" | grep -o "=$userLanguage"; then
|
releaseURL="https://ftp.mozilla.org/pub/firefox/releases/latest/README.txt"
|
||||||
userLanguage=$(echo $userLanguage | cut -c 1-2)
|
until curl -fs $releaseURL | grep -q "=$userLanguage"; do
|
||||||
if ! curl -fs "https://ftp.mozilla.org/pub/firefox/releases/latest/README.txt" | grep "=$userLanguage"; then
|
if [ ${#userLanguage} -eq 2 ]; then
|
||||||
userLanguage="en_US"
|
break
|
||||||
fi
|
fi
|
||||||
|
printlog "No locale matching '$userLanguage', trying '${userLanguage:0:2}'"
|
||||||
|
userLanguage=${userLanguage:0:2}
|
||||||
|
done
|
||||||
|
printlog "Using language '$userLanguage' for download."
|
||||||
|
downloadURL="https://download.mozilla.org/?product=firefox-latest-ssl&os=osx&lang=$userLanguage"
|
||||||
|
if ! curl -sfL --output /dev/null -r 0-0 $downloadURL; then
|
||||||
|
printlog "Download not found for '$userLanguage', using default ('en-US')."
|
||||||
|
downloadURL="https://download.mozilla.org/?product=firefox-latest-ssl&os=osx"
|
||||||
fi
|
fi
|
||||||
printlog "Using language $userLanguage for download."
|
appNewVersion=$(curl -fsIL $downloadURL | awk -F releases/ '/Location:/ {split($2,a,"/"); print a[1]}')
|
||||||
downloadURL="https://download.mozilla.org/?product=firefox-latest&os=osx&lang=$userLanguage"
|
|
||||||
if ! curl -sfL --output /dev/null -r 0-0 "$downloadURL" ; then
|
|
||||||
printlog "Download not found for that language. Using en-US"
|
|
||||||
downloadURL="https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US"
|
|
||||||
fi
|
|
||||||
appNewVersion=$(curl -fs https://www.mozilla.org/en-US/firefox/releases/ | grep '<html' | grep -o -i -e "data-latest-firefox=\"[0-9.]*\"" | cut -d '"' -f2)
|
|
||||||
expectedTeamID="43AQ936H96"
|
expectedTeamID="43AQ936H96"
|
||||||
blockingProcesses=( firefox )
|
blockingProcesses=( firefox )
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user