diff --git a/slack-day b/slack-day index 8b7d97a..17ffbb1 100755 --- a/slack-day +++ b/slack-day @@ -49,7 +49,10 @@ then $EXE_FILE /dev/null & # start slack process in detached mode elif [ "$(uname)" == "Linux" ] # Linux OS then - killall "slack" # kill all slack processes + if [ $(ps aux | grep -i slack | wc -l) -gt 1 ] + then + killall "slack" # kill all slack processes + fi slack /dev/null & # start slack process in detached mode elif [ "$(uname)" == "Darwin" ] # Mac OS then @@ -57,7 +60,11 @@ then then sudo asar pack ./files/app.asar.unpacked $ASAR_FILE fi - killall "Slack" # kill all slack processes + + if [ $(ps aux | grep -i Slack | wc -l) -gt 1 ] + then + killall "Slack" # kill all slack processes + fi /Applications/Slack.app/Contents/MacOS/Slack /dev/null & # start slack process in detached mode fi fi \ No newline at end of file diff --git a/slack-theme b/slack-theme index 6732a5e..2c49e95 100755 --- a/slack-theme +++ b/slack-theme @@ -403,7 +403,10 @@ then $EXE_FILE /dev/null & # start slack process in detached mode elif [ "$(uname)" == "Linux" ] # Linux OS then - killall "slack" # kill all slack processes + if [ $(ps aux | grep -i slack | wc -l) -gt 1 ] + then + killall "slack" # kill all slack processes + fi slack /dev/null & # start slack process in detached mode elif [ "$(uname)" == "Darwin" ] # Mac OS then @@ -411,7 +414,11 @@ then then sudo $ASAR pack "$DIR/files/app.asar.unpacked" $ASAR_FILE fi - killall "Slack" # kill all slack processes + + if [ $(ps aux | grep -i Slack | wc -l) -gt 1 ] + then + killall "Slack" # kill all slack processes + fi /Applications/Slack.app/Contents/MacOS/Slack /dev/null & # start slack process in detached mode fi else