From 366f9a9f0a2fa37bea063c7c4793812181f95853 Mon Sep 17 00:00:00 2001 From: DanielSGH Date: Wed, 15 Feb 2023 18:29:44 +0000 Subject: [PATCH] check if firefox running before uninstall --- install.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index bbe2655..8e46bb6 100755 --- a/install.sh +++ b/install.sh @@ -20,6 +20,13 @@ delete_pref() { # PRE-INSTALL PHASE # ##################### +firefox_proc=$(pgrep firefox); +if [ ! -z $firefox_proc ]; then + echo "Before installing, please make sure firefox is not running." + echo "Otherwise, changes cannot be made to prefs.js" + exit 0; +fi + # Check if issued `./installer.sh uninstall` if [[ $1 == "uninstall" ]]; then echo "Warning: the following command will delete said folder and wipe out everything in its sub-directories" @@ -33,13 +40,6 @@ if [[ $1 == "uninstall" ]]; then exit 0; fi -firefox_proc=$(pgrep firefox); -if [ ! -z $firefox_proc ]; then - echo "Before installing, please make sure firefox is not running." - echo "Otherwise, changes cannot be made to prefs.js" - exit 0; -fi - echo "Detecting if firefox is installed on your system..." if [ ! -f /usr/bin/firefox ] && { [ ! -f /usr/lib/firefox/firefox ] && [ ! -f /usr/lib/firefox-developer-edition/firefox ]; }; then echo "ERROR: firefox not found..."