Just use /proc to see if a process is running
This commit is contained in:
parent
69a1c39cbc
commit
987c655fcc
|
@ -5,3 +5,4 @@ A simple rc script to kickstart your system.
|
||||||
## depends
|
## depends
|
||||||
|
|
||||||
* Enabled sysrq or halt from suckless.org's ubase.
|
* Enabled sysrq or halt from suckless.org's ubase.
|
||||||
|
* /proc support.
|
||||||
|
|
|
@ -39,7 +39,7 @@ get_procs_to_kill() {
|
||||||
|
|
||||||
pids_exist() {
|
pids_exist() {
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
if kill -0 "$i" 2>/dev/null; then
|
if [[ -d "/proc/$i" ]]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue
Block a user