72 lines
2.1 KiB
Bash
Executable File
72 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
|
|
|
|
################
|
|
#Check for root#
|
|
################
|
|
if [ ! $USERNAME = "root" ]; then
|
|
pkexec /usr/share/browser-manager/firefox/install
|
|
exit 0
|
|
fi
|
|
|
|
##########
|
|
#Question#
|
|
##########
|
|
zenity --question --title="Continue?" --text "The use of Mozilla Firefox is governed by the Terms found at
|
|
https://www.mozilla.org/en-US/about/legal/terms/firefox/,
|
|
are you sure you want to install Firefox?" --no-wrap
|
|
|
|
if [ ! $? -eq 0 ]; then
|
|
exit
|
|
fi
|
|
|
|
###############################
|
|
#Check if program is installed#
|
|
###############################
|
|
dpkg --get-selections | grep -P -q "firefox\t*install"
|
|
|
|
if [ $? -eq 0 ]; then
|
|
if [ -e "/usr/bin/firefox" ]; then
|
|
zenity --info --title="Information" --text="Firefox is already installed!"
|
|
exit 0
|
|
fi
|
|
fi
|
|
|
|
###################################
|
|
#Check if program is not installed#
|
|
###################################
|
|
dpkg --get-selections | grep -P -q "firefox\t*install"
|
|
|
|
if [ ! $? -eq 0 ]; then
|
|
if [ ! -e "/usr/bin/firefox" ]; then
|
|
|
|
#################
|
|
#Install program#
|
|
#################
|
|
apt-get update | zenity --progress --no-cancel --title="Installing..." --text="Updating package archive..." --pulsate --auto-close && apt-get -y install firefox | zenity --progress --no-cancel --title="Installing..." --text="Downloading and Installing..." --pulsate --auto-close
|
|
fi
|
|
######################
|
|
#Double Check Package#
|
|
######################
|
|
dpkg --get-selections | grep -P -q "firefox\t*install"
|
|
|
|
if [ $? -eq 0 ]; then
|
|
if [ -e "/usr/bin/firefox" ]; then
|
|
zenity --info --title="Installation Complete" --text="Firefox 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
|