2022-03-17 10:14:08 +01:00
|
|
|
#!/bin/bash
|
2022-02-23 12:10:34 +01:00
|
|
|
|
2022-07-23 13:08:24 +02:00
|
|
|
PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH"
|
2022-03-23 08:16:01 +01:00
|
|
|
|
2022-03-01 13:55:05 +01:00
|
|
|
# abort if not executed as root
|
2022-02-23 12:10:34 +01:00
|
|
|
if [[ $(id -u) != "0" ]]; then
|
2022-02-25 16:33:46 +01:00
|
|
|
echo "Usage: run ${0##*/} as root" 1>&2
|
2022-02-23 12:10:34 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-03-23 08:16:01 +01:00
|
|
|
SYSTEM_ARCH=$("$(dirname "$0")/arch.sh")
|
2022-02-25 16:33:46 +01:00
|
|
|
DESTARCH=${2:-$SYSTEM_ARCH}
|
|
|
|
. /etc/os-release
|
2022-02-23 12:10:34 +01:00
|
|
|
|
2022-02-25 16:33:46 +01:00
|
|
|
if [[ $DESTARCH != "amd64" ]]; then
|
2022-02-23 12:10:34 +01:00
|
|
|
echo "Google Chrome (stable) is only available for AMD64."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2022-02-25 16:33:46 +01:00
|
|
|
echo "Installing Google Chrome (stable) on ${ID} for ${DESTARCH^^}..."
|
2022-02-23 12:10:34 +01:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2022-03-23 08:16:01 +01:00
|
|
|
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
|
|
|
|
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
|
|
|
|
apt-get update
|
|
|
|
apt-get -qq install google-chrome-stable
|
2022-02-23 12:10:34 +01:00
|
|
|
|
|
|
|
echo "Done."
|