Created
January 14, 2025 04:34
-
-
Save moonexpr/81f83a48304e1a5e1742727ff6a3fd42 to your computer and use it in GitHub Desktop.
Updates Google Chrome
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 | |
shopt -s extglob | |
download_file() | |
{ | |
echo $1 | |
curl -L# "$1" -o $2 | |
} | |
install_pkg() | |
{ | |
echo "[discord] Installing Debian package." | |
sudo dpkg -i $1 | |
} | |
echo "[chrome] Permission to download & install remote Debian package?" | |
sudo echo a > /dev/null | |
if [[ $? > 0 ]]; then | |
echo -e "[chrome] Permission denied, aborting." | |
exit 2 | |
fi | |
URL="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" | |
if [[ -n `command -v curl_resolve` ]]; then | |
URL=`curl_resolve $URL` | |
fi | |
PKG_FILE=~/chrome.deb | |
download_file $URL $PKG_FILE | |
install_pkg $PKG_FILE | |
rm -f $PKG_FILE &> /dev/null | |
#vim: set sw=4 ts=4 et |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment