Skip to content

Instantly share code, notes, and snippets.

@raulpy271
Last active July 13, 2021 21:04
Show Gist options
  • Save raulpy271/3a05c3fd138013fcc4edb9b8cbdc6ac1 to your computer and use it in GitHub Desktop.
Save raulpy271/3a05c3fd138013fcc4edb9b8cbdc6ac1 to your computer and use it in GitHub Desktop.
Using Discord in linux I have this problem: When the user click's in the close button , the Discord app don't exit, this script close it anyway!
#!/bin/bash
# Use without download:
# curl -s https://gist.githubusercontent.com/raulpy271/3a05c3fd138013fcc4edb9b8cbdc6ac1/raw/ee8b56ffbe54751402c766cf15a3a13bae6f1c7c/kill_discord.sh | bash
process='Discord'
proces_exist=`pidstat | grep -i $process`
if [ -n "$proces_exist" ]
then
echo "Bye $process :)"
killall $process -s 9
else
echo "$process not found :("
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment