- Updated killdups to end all orphaned processes before initiating a new process

This commit is contained in:
Ben Reaves
2020-08-04 17:37:59 -05:00
parent d180b94bd9
commit f37d7d09ec

View File

@@ -2,7 +2,7 @@
xkeycount=$(pgrep 'xkeysnail' | wc -l)
if [[ $xkeycount -lt 1 ]]; then
if [[ $xkeycount -le 1 ]]; then
# No dups found
exit 0
fi
@@ -13,7 +13,8 @@ if ! $(zenity --question --text="Wrong password, try again?"); then
exit 1
fi
done
pgrep 'xkeysnail' | head -n -1 | xargs -r -n1 sudo kill
# pgrep 'xkeysnail' | head -n -1 | xargs -r -n1 sudo kill
pgrep 'xkeysnail' | xargs -r -n1 sudo kill
sudo -K # remove privilege
# No dups should exist
exit 0