Last active
October 1, 2022 20:44
-
-
Save MaxenceCauderlier/6319ae4a245ea4c5093e74bf15eea098 to your computer and use it in GitHub Desktop.
Installer Firefox Nightly sur Linux 64 bits, en français.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mettre le tout dans un fichier sans extension, et lancez
sudo sh monscript
Ou alors avec Curl :