70 lines
1.9 KiB
Plaintext
70 lines
1.9 KiB
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
|
||
|
|
||
|
################
|
||
|
#Check for root#
|
||
|
################
|
||
|
if [ ! $USERNAME = "root" ]; then
|
||
|
pkexec /usr/share/browser-manager/opera/uninstall
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
##########
|
||
|
#Question#
|
||
|
##########
|
||
|
zenity --question --title="Continue?" --text "Are you sure you want to remove Opera?"
|
||
|
|
||
|
if [ ! $? -eq 0 ]; then
|
||
|
exit
|
||
|
fi
|
||
|
|
||
|
###################################
|
||
|
#Check if program is not installed#
|
||
|
###################################
|
||
|
dpkg --get-selections | grep -P -q "opera-stable\t*install"
|
||
|
|
||
|
if [ ! $? -eq 0 ]; then
|
||
|
if [ ! -e "/usr/bin/opera" ]; then
|
||
|
zenity --info --title="Information" --text="Opera is not installed!"
|
||
|
exit 0
|
||
|
fi
|
||
|
fi
|
||
|
|
||
|
###############################
|
||
|
#Check if program is installed#
|
||
|
###############################
|
||
|
dpkg --get-selections | grep -P -q "opera-stable\t*install"
|
||
|
|
||
|
if [ $? -eq 0 ]; then
|
||
|
if [ -e "/usr/bin/opera" ]; then
|
||
|
|
||
|
###################
|
||
|
#Uninstall program#
|
||
|
###################
|
||
|
apt-get -y remove opera-stable && rm /etc/apt/sources.list.d/opera-stable.list && apt-get update | zenity --progress --no-cancel --title="Uninstalling..." --text="Uninstalling..." --pulsate --auto-close
|
||
|
fi
|
||
|
######################
|
||
|
#Double Check Package#
|
||
|
######################
|
||
|
dpkg --get-selections | grep -P -q "opera-stable\t*install"
|
||
|
|
||
|
if [ ! $? -eq 0 ]; then
|
||
|
if [ ! -e "/usr/bin/opera" ]; then
|
||
|
zenity --info --title="Uninstalled Opera" --text="Opera uninstalled 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
|