mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 05:44:08 -07:00
pidof fallback for service list
This commit is contained in:
parent
5dbadaa730
commit
18ebaec857
1 changed files with 4 additions and 0 deletions
|
@ -31,6 +31,10 @@ get_srv_state() {
|
||||||
else
|
else
|
||||||
pids=$(pidof -x $proc_name |tr ' ' '|')
|
pids=$(pidof -x $proc_name |tr ' ' '|')
|
||||||
fi
|
fi
|
||||||
|
if [ -z "$pids" ]; then
|
||||||
|
#fallback to pgrep
|
||||||
|
pids=$(pgrep $proc_name |tr '\n' '|')
|
||||||
|
fi
|
||||||
if [ ! -z "$pids" ]; then
|
if [ ! -z "$pids" ]; then
|
||||||
pid=$(echo $pids|cut -f 1 -d \|)
|
pid=$(echo $pids|cut -f 1 -d \|)
|
||||||
pids=$(egrep "$pids" $tmp_file)
|
pids=$(egrep "$pids" $tmp_file)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue