fix browser setup script (#561)

This commit is contained in:
Guru Swarupa 2024-09-20 20:13:08 +05:30 committed by GitHub
parent 2662aa03c4
commit ad03095f9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,9 +4,10 @@
install_chrome() { install_chrome() {
printf "%b\n" "${YELLOW}Installing Google Chrome..${RC}." printf "%b\n" "${YELLOW}Installing Google Chrome..${RC}."
if ! command_exists google-chrome; then
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) apt-get|nala)
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
"$ESCALATION_TOOL" dpkg -i google-chrome-stable_current_amd64.deb "$ESCALATION_TOOL" dpkg -i google-chrome-stable_current_amd64.deb
;; ;;
zypper) zypper)
@ -18,23 +19,26 @@ install_chrome() {
"$AUR_HELPER" -S --noconfirm google-chrome "$AUR_HELPER" -S --noconfirm google-chrome
;; ;;
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install fedora-workstation-repositories "$ESCALATION_TOOL" "$PACKAGER" install -y fedora-workstation-repositories
"$ESCALATION_TOOL" "$PACKAGER" config-manager --set-enabled google-chrome "$ESCALATION_TOOL" "$PACKAGER" config-manager --set-enabled google-chrome
"$ESCALATION_TOOL" "$PACKAGER" install google-chrome-stable "$ESCALATION_TOOL" "$PACKAGER" install -y google-chrome-stable
;; ;;
*) *)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}" printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
;; ;;
esac esac
else
printf "%b\n" "${GREEN}Google Chrome Browser is already installed.${RC}"
fi
} }
install_thorium() { install_thorium() {
printf "%b\n" "${YELLOW}Installing Thorium Browser...${RC}" printf "%b\n" "${YELLOW}Installing Thorium Browser...${RC}"
if ! command_exists thorium-browser; then
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) apt-get|nala)
"$ESCALATION_TOOL" rm -fv /etc/apt/sources.list.d/thorium.list "$ESCALATION_TOOL" rm -fv /etc/apt/sources.list.d/thorium.list
"$ESCALATION_TOOL" wget --no-hsts -P /etc/apt/sources.list.d/ http://dl.thorium.rocks/debian/dists/stable/thorium.list "$ESCALATION_TOOL" curl http://dl.thorium.rocks/debian/dists/stable/thorium.list -o /etc/apt/sources.list.d/thorium.list
"$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install -y thorium-browser "$ESCALATION_TOOL" "$PACKAGER" install -y thorium-browser
;; ;;
@ -51,15 +55,17 @@ install_thorium() {
exit 1 exit 1
;; ;;
esac esac
printf "%b\n" "${GREEN}Thorium Browser installed successfully!${RC}" else
printf "%b\n" "${GREEN}Thorium Browser is already installed.${RC}"
fi
} }
install_firefox() { install_firefox() {
printf "%b\n" "${YELLOW}Installing Mozilla Firefox...${RC}" printf "%b\n" "${YELLOW}Installing Mozilla Firefox...${RC}"
if ! command_exists firefox; then
case "$PACKAGER" in case "$PACKAGER" in
apt-get) apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" install -y firefox-esr
"$ESCALATION_TOOL" "$PACKAGER" install -y firefox
;; ;;
zypper) zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install MozillaFirefox "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install MozillaFirefox
@ -68,22 +74,25 @@ install_firefox() {
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm firefox "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm firefox
;; ;;
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install firefox "$ESCALATION_TOOL" "$PACKAGER" install -y firefox
;; ;;
*) *)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}" printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
;; ;;
esac esac
else
printf "%b\n" "${GREEN}Firefox Browser is already installed.${RC}"
fi
} }
install_librewolf() { install_librewolf() {
printf "%b\n" "${YELLOW}Installing Librewolf...${RC}" printf "%b\n" "${YELLOW}Installing Librewolf...${RC}"
if ! command_exists librewolf; then
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" update && "$ESCALATION_TOOL" "$PACKAGER" install -y wget gnupg lsb-release apt-transport-https ca-certificates "$ESCALATION_TOOL" "$PACKAGER" install -y gnupg lsb-release apt-transport-https ca-certificates
distro=`if echo " una bookworm vanessa focal jammy bullseye vera uma " | grep -q " $(lsb_release -sc) "; then lsb_release -sc; else echo focal; fi` distro=`if echo " una bookworm vanessa focal jammy bullseye vera uma " | grep -q " $(lsb_release -sc) "; then lsb_release -sc; else echo focal; fi`
wget -O- https://deb.librewolf.net/keyring.gpg | "$ESCALATION_TOOL" gpg --dearmor -o /usr/share/keyrings/librewolf.gpg curl -fsSL https://deb.librewolf.net/keyring.gpg | "$ESCALATION_TOOL" gpg --dearmor -o /usr/share/keyrings/librewolf.gpg
echo "Types: deb echo "Types: deb
URIs: https://deb.librewolf.net URIs: https://deb.librewolf.net
Suites: $distro Suites: $distro
@ -113,21 +122,24 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/
exit 1 exit 1
;; ;;
esac esac
printf "%b\n" "${GREEN}Librewolf installed successfully!${RC}" else
printf "%b\n" "${GREEN}LibreWolf Browser is already installed.${RC}"
fi
} }
install_brave() { install_brave() {
printf "%b\n" "${YELLOW}Installing Brave...${RC}" printf "%b\n" "${YELLOW}Installing Brave...${RC}"
if ! command_exists brave; then
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install curl "$ESCALATION_TOOL" "$PACKAGER" install -y curl
"$ESCALATION_TOOL" curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg "$ESCALATION_TOOL" curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main"| "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/brave-browser-release.list
"$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install brave-browser "$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser
;; ;;
zypper) zypper)
"$ESCALATION_TOOL" "$PACKAGER"install curl "$ESCALATION_TOOL" "$PACKAGER" install -y curl
"$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc "$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
"$ESCALATION_TOOL" "$PACKAGER" addrepo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo "$ESCALATION_TOOL" "$PACKAGER" addrepo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install brave-browser "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install brave-browser
@ -136,64 +148,71 @@ install_brave() {
"$AUR_HELPER" -S --noconfirm brave-bin "$AUR_HELPER" -S --noconfirm brave-bin
;; ;;
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install dnf-plugins-core "$ESCALATION_TOOL" "$PACKAGER" install -y dnf-plugins-core
"$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo "$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
"$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc "$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
"$ESCALATION_TOOL" "$PACKAGER" install brave-browser "$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser
;; ;;
*) *)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}" printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
;; ;;
esac esac
else
printf "%b\n" "${GREEN}Brave Browser is already installed.${RC}"
fi
} }
install_vivaldi() { install_vivaldi() {
if ! command_exists vivaldi; then
printf "%b\n" "${YELLOW}Installing Vivaldi...${RC}" printf "%b\n" "${YELLOW}Installing Vivaldi...${RC}"
wget https://downloads.vivaldi.com/snapshot/install-vivaldi.sh curl -fsSL https://downloads.vivaldi.com/snapshot/install-vivaldi.sh | sh
sh install-vivaldi.sh if [ $? -eq 0 ]; then
printf "%b\n" "${GREEN}Vivaldi installed successfully!${RC}"
else
printf "%b\n" "${RED}Vivaldi installation failed!${RC}"
fi
else
printf "%b\n" "${GREEN}Vivaldi Browser is already installed.${RC}"
fi
} }
install_chromium() { install_chromium() {
printf "%b\n" "${YELLOW}Installing Chromium...${RC}" printf "%b\n" "${YELLOW}Installing Chromium...${RC}"
if ! command_exists chromium; then
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) apt-get|nala|zypper)
"$ESCALATION_TOOL" "$PACKAGER" install -y chromium "$ESCALATION_TOOL" "$PACKAGER" install -y chromium
;; ;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install chromium
;;
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm chromium "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm chromium
;; ;;
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install --assumeyes https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm "$ESCALATION_TOOL" "$PACKAGER" install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
"$ESCALATION_TOOL" "$PACKAGER" install chromium "$ESCALATION_TOOL" "$PACKAGER" install -y chromium
;; ;;
*) *)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}" printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
;; ;;
esac esac
else
printf "%b\n" "${GREEN}Chromium Browser is already installed.${RC}"
fi
} }
install_lynx() { install_lynx() {
printf "%b\n" "${YELLOW}Installing Lynx...${RC}" printf "%b\n" "${YELLOW}Installing Lynx...${RC}"
if ! command_exists lynx; then
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y lynx
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" install lynx
;;
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm lynx "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm lynx
;; ;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" install lynx
;;
*) *)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}" "$ESCALATION_TOOL" "$PACKAGER" install -y lynx
;; ;;
esac esac
else
printf "%b\n" "${GREEN}Lynx TUI Browser is already installed.${RC}"
fi
} }
browserSetup() { browserSetup() {