mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 05:44:07 -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
|
||||
pids=$(pidof -x $proc_name |tr ' ' '|')
|
||||
fi
|
||||
if [ -z "$pids" ]; then
|
||||
#fallback to pgrep
|
||||
pids=$(pgrep $proc_name |tr '\n' '|')
|
||||
fi
|
||||
if [ ! -z "$pids" ]; then
|
||||
pid=$(echo $pids|cut -f 1 -d \|)
|
||||
pids=$(egrep "$pids" $tmp_file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue