Skip to content

Instantly share code, notes, and snippets.

@moonexpr
Created January 14, 2025 04:34
Show Gist options
  • Save moonexpr/81f83a48304e1a5e1742727ff6a3fd42 to your computer and use it in GitHub Desktop.
Save moonexpr/81f83a48304e1a5e1742727ff6a3fd42 to your computer and use it in GitHub Desktop.
Updates Google Chrome
#!/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