2024-09-28 20:13:03 +01:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
. ../../common-script.sh
|
|
|
|
|
2024-10-31 19:19:22 +00:00
|
|
|
installVivaldi() {
|
|
|
|
if ! command_exists vivaldi; then
|
|
|
|
printf "%b\n" "${YELLOW}Installing Vivaldi...${RC}"
|
2024-09-28 20:13:03 +01:00
|
|
|
case "$PACKAGER" in
|
2024-10-31 19:19:22 +00:00
|
|
|
apt-get|nala)
|
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -y curl
|
|
|
|
"$ESCALATION_TOOL" curl -fsSL https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor | sudo dd of=/usr/share/keyrings/vivaldi-browser.gpg
|
|
|
|
"$ESCALATION_TOOL" echo "deb [signed-by=/usr/share/keyrings/vivaldi-browser.gpg arch=$(dpkg --print-architecture)] https://repo.vivaldi.com/archive/deb/ stable main" | sudo dd of=/etc/apt/sources.list.d/vivaldi-archive.list
|
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" update
|
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -y vivaldi-stable
|
|
|
|
;;
|
|
|
|
dnf)
|
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -y dnf-plugins-core
|
2024-11-11 16:12:16 +00:00
|
|
|
dnf_version=$(dnf --version | head -n 1 | cut -d '.' -f 1)
|
|
|
|
if [ "$dnf_version" -eq 4 ]; then
|
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://repo.vivaldi.com/stable/vivaldi-fedora.repo
|
|
|
|
else
|
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" config-manager addrepo --from-repofile=https://repo.vivaldi.com/stable/vivaldi-fedora.repo
|
|
|
|
fi
|
2024-10-31 19:19:22 +00:00
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -y vivaldi-stable
|
|
|
|
;;
|
|
|
|
zypper)
|
|
|
|
"$ESCALATION_TOOL" zypper ar https://repo.vivaldi.com/archive/vivaldi-suse.repo
|
|
|
|
"$ESCALATION_TOOL" zypper --non-interactive --gpg-auto-import-keys in vivaldi-stable
|
|
|
|
;;
|
2024-09-28 20:13:03 +01:00
|
|
|
pacman)
|
2024-10-31 19:19:22 +00:00
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm vivaldi
|
2024-09-28 20:13:03 +01:00
|
|
|
;;
|
|
|
|
*)
|
2024-10-31 19:19:22 +00:00
|
|
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
|
|
|
exit 1
|
2024-09-28 20:13:03 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
else
|
2024-10-31 19:19:22 +00:00
|
|
|
printf "%b\n" "${GREEN}Vivaldi Browser is already installed.${RC}"
|
2024-09-28 20:13:03 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
checkEnv
|
|
|
|
checkEscalationTool
|
2024-10-31 19:19:22 +00:00
|
|
|
installVivaldi
|