Peppermint-Classic-Build-Files/PeppermintOS-Classic-amd64/config/includes.chroot/usr/share/browser-manager/vivaldi/install

73 lines
2.6 KiB
Plaintext
Raw Normal View History

#!/bin/bash
################
#Check for root#
################
if [ ! $USERNAME = "root" ]; then
pkexec /usr/share/browser-manager/vivaldi/install
exit 0
fi
##########
#Question#
##########
zenity --question --title="Continue?" --text "The usage of Vivaldi is governed by the Vivaldi EULA and Privacy Policy
found on https://vivaldi.com/privacy/, are you sure you want to install
Vivaldi?" --no-wrap
if [ ! $? -eq 0 ]; then
exit
fi
###############################
#Check if program is installed#
###############################
dpkg --get-selections | grep -q "vivaldi-stable.* install"
if [ $? -eq 0 ]; then
if [ -e "/usr/bin/vivaldi" ]; then
zenity --info --title="Information" --text="Vivaldi is already installed!"
exit 0
fi
fi
###################################
#Check if program is not installed#
###################################
dpkg --get-selections | grep -q "vivaldi-stable.* install"
if [ ! $? -eq 0 ]; then
if [ ! -e "/usr/bin/vivaldi" ]; then
#################
#Install program#
#################
apt-get update | zenity --progress --no-cancel --no-cancel --title="Installing..." --text="Updating package archive..." --pulsate --auto-close && wget -q -O - http://repo.vivaldi.com/stable/linux_signing_key.pub | apt-key add - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1397BC53640DB551 8D04CE49EFB20B23 | zenity --progress --no-cancel --title="Installing..." --text="Obtaining Vivaldi GPG Key..." --pulsate --auto-close
echo -e "### THIS FILE IS AUTOMATICALLY CONFIGURED ###\n# You may comment out this entry, but any other modifications may be lost.\ndeb http://repo.vivaldi.com/stable/deb/ stable main" > /etc/apt/sources.list.d/vivaldi.list && apt-get update && apt-get -y install vivaldi-stable | zenity --progress --no-cancel --no-cancel --title="Installing..." --text="Downloading and Installing..." --pulsate --auto-close
fi
######################
#Double Check Package#
######################
dpkg --get-selections | grep -q "vivaldi.* install"
if [ $? -eq 0 ]; then
if [ -e "/usr/bin/vivaldi" ]; then
zenity --info --title="Installation Complete" --text="Vivaldi installed successfully!"
exit 0
fi
#######
#Error#
#######
zenity --error --text="An error occured." --title="Error"
exit 0
fi
fi
#######
#Error#
#######
zenity --error --text="An error occured." --title="Error"
exit 0