Last active
August 17, 2020 19:40
-
-
Save mrvaldes/8cfde6b71ce4986084b3d5cbf28df124 to your computer and use it in GitHub Desktop.
update firefox
This file contains hidden or 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/bash | |
DOWNLOAD_DIR="${HOME}/Downloads" | |
FIREFOX_DIR="/usr/lib/firefox_dev" | |
DESKTOPFILE="${HOME}/.local/share/applications/firefox_dev.desktop" | |
URL="https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=en-US" | |
REDIR_URL=$(curl --head --silent "${URL}" --write-out "%{redirect_url}") | |
FILENAME=$(basename "${REDIR_URL}") | |
FILENAME_PATH="${DOWNLOAD_DIR}/${FILENAME}" | |
echo $FILENAME_PATH | |
curl --location "${URL}" --output "${FILENAME_PATH}" | |
sudo mkdir -p ${FIREFOX_DIR} && sudo rm -rf ${FIREFOX_DIR}/* && sudo tar xjv -C "${FIREFOX_DIR}" -f "${FILENAME_PATH}" | |
cat <<EOT > $DESKTOPFILE | |
[Desktop Entry] | |
Name=Firefox Developer | |
GenericName=Firefox Developer Edition | |
Exec=${FIREFOX_DIR}/firefox/firefox -P %u | |
Terminal=false | |
Icon=${FIREFOX_DIR}/firefox/browser/chrome/icons/default/default128.png | |
Type=Application | |
Categories=Application;Network;X-Developer; | |
Comment=Firefox Developer Edition Web Browser. | |
EOT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment