check if firefox running before uninstall

This commit is contained in:
DanielSGH 2023-02-15 18:29:44 +00:00
parent 7e0ba72e78
commit 366f9a9f0a

View file

@ -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..."