Skip to content

Instantly share code, notes, and snippets.

@fusion809
Created September 26, 2019 05:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fusion809/cd386754c953d8715d3862629500978b to your computer and use it in GitHub Desktop.
Save fusion809/cd386754c953d8715d3862629500978b to your computer and use it in GitHub Desktop.
#!/bin/bash
CURRENT_VERSION=$(~/Downloads/waterfox/waterfox --version | cut -d ' ' -f 3)
LATEST_VERSION=$(wget -cqO- https://www.waterfox.net/ | grep linux64 | head -n 1 | cut -d '-' -f 4 | sed 's/.en//g')
if [[ ${CURRENT_VERSION} == ${LATEST_VERSION} ]]; then
printf "Waterfox is up to date at version ${CURRENT_VERSION}.\n"
else
rm -rf ~/Downloads/waterfox*
wget -cqO- https://storage-waterfox.netdna-ssl.com/releases/linux64/installer/waterfox-${LATEST_VERSION}.en-US.linux-x86_64.tar.bz2 | tar xj
fi
if ! [[ -f $HOME/.local/share/applications/waterfox.desktop ]]; then
wget -c "https://aur.archlinux.org/cgit/aur.git/plain/waterfox.desktop?h=waterfox-bin" -O $HOME/.local/share/applications/waterfox.desktop
chmod +x $HOME/.local/share/applications/waterfox.desktop
sed -i -e "s|Exec=waterfox|Exec=$HOME/Downloads/waterfox/waterfox|g" $HOME/.local/share/applications/waterfox.desktop
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment