Created
September 26, 2019 05:30
-
-
Save fusion809/cd386754c953d8715d3862629500978b to your computer and use it in GitHub Desktop.
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/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