From a9cd9145d9d006a608bf85c7756f3ee4a21a99fd Mon Sep 17 00:00:00 2001 From: DanielSGH Date: Sat, 11 Feb 2023 00:42:12 +0000 Subject: [PATCH] detect if firefox is running --- install.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index e0b0736..69c7474 100644 --- a/install.sh +++ b/install.sh @@ -33,6 +33,13 @@ 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 ]; }; then echo "ERROR: firefox not found..." @@ -94,4 +101,4 @@ if [[ $OSTYPE == "darwin"* ]]; then set_pref "widget.macos.native-context-menus" "false" fi -echo "Finished successfully! Please (re)start firefox to see the changes."; +echo "Finished successfully! Please start firefox to see the changes.";