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