Update stop command
This commit is contained in:
parent
0e6c509781
commit
e2ab722e71
@ -14,7 +14,19 @@ function start {
|
|||||||
|
|
||||||
# stop running comfortable-swipe commands (except self)
|
# stop running comfortable-swipe commands (except self)
|
||||||
function stop {
|
function stop {
|
||||||
kill -- -$(pgrep -f comfortable-swipe | fgrep -v $$)
|
local pids="$(pgrep -f comfortable-swipe | fgrep -v $$)"
|
||||||
|
local stopped=""
|
||||||
|
for pid in "$pids"; do
|
||||||
|
# stop process tree
|
||||||
|
if kill -- -$pid 2> /dev/null; then
|
||||||
|
stopped=" $(echo $pid)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ ! -z "$stopped" ]]; then
|
||||||
|
echo "comfortable-swipe stopped"
|
||||||
|
else
|
||||||
|
echo "comfortable-swipe is not running"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user