Skip to content

Instantly share code, notes, and snippets.

@MaxenceCauderlier
Last active October 1, 2022 20:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaxenceCauderlier/6319ae4a245ea4c5093e74bf15eea098 to your computer and use it in GitHub Desktop.
Save MaxenceCauderlier/6319ae4a245ea4c5093e74bf15eea098 to your computer and use it in GitHub Desktop.
Installer Firefox Nightly sur Linux 64 bits, en français.
#!/bin/sh
START_CMD="firefox-nightly"
INSTALLATION_DIR="/opt/${START_CMD}"
# Download the tarball, unpack and install
URL="https://download.mozilla.org/?product=firefox-nightly-latest-l10n-ssl&os=linux64&lang=fr"
echo "Download from '$URL'"
echo ""
curl -L -o ${HOME}/${START_CMD}.tar.bz2 $URL
if tar -xf ${HOME}/${START_CMD}.tar.bz2 --directory=${HOME}; then
# Create an application launcher file based on the regular firefox launcher
cat /usr/share/applications/firefox.desktop | sed -r 's+Name=Firefox+Name=Firefox Nightly+g' | sed -r "s+Exec=/usr/lib/firefox/firefox+Exec=/opt/${START_CMD}/firefox+g" | sed -r "s+Icon=firefox+Icon=$(echo ${INSTALLATION_DIR} | sed -r 's+/+\\/+g')/browser/chrome/icons/default/default128.png+g" > ${HOME}/firefox/firefox.desktop
# Remove the installation folder and the symlink, they might already exist
sudo rm -rf ${INSTALLATION_DIR} /bin/${START_CMD}
sudo mv ${HOME}/firefox ${INSTALLATION_DIR}
sudo ln -s ${INSTALLATION_DIR}/firefox /bin/${START_CMD}
fi
rm ${HOME}/${START_CMD}.tar.bz2
# Add to applications list
sudo ln -sf ${INSTALLATION_DIR}/firefox.desktop /usr/share/applications/${START_CMD}.desktop
sudo chmod +x ${INSTALLATION_DIR}/firefox.desktop
sudo chmod +x /usr/share/applications/${START_CMD}.desktop
INIFILE="/opt/firefox-nightly/platform.ini"
B=$(awk -F "=" '/BuildID/ {print $2}' $INIFILE)
VERSION=$(awk -F "=" '/Milestone/ {print $2}' $INIFILE)
echo ""
echo "Firefox Nightly $VERSION ($(echo $B | cut -c1-4)-$(echo $B | cut -c5-6)-$(echo $B | cut -c7-8)) Installed"
echo "Run with: ${START_CMD}"
@MaxenceCauderlier
Copy link
Author

MaxenceCauderlier commented Sep 29, 2022

Mettre le tout dans un fichier sans extension, et lancez sudo sh monscript

Ou alors avec Curl :

 sudo curl -L https://gist.githubusercontent.com/MaxenceCauderlier/6319ae4a245ea4c5093e74bf15eea098/raw/301d89b6fbaa4a0c5275d60808a30fd21ecd1575/nightly-fr | sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment