Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: bec40a9d5e
Fetching contributors…

Cannot retrieve contributors at this time

executable file 37 lines (28 sloc) 0.588 kb
#!/bin/sh
trace_filter nginx || set -o xtrace
local line header
typeset -a master_list worker_list
header="$(ps auxww | head -1)"
(( master_pid > 0 )) || succeed "No Nginx master processes was found."
while read -r line
do
if [[ "$line" =~ nginx ]]
then
if [[ "$line" =~ master ]]
then
master_list+=("${line}")
elif [[ "$line" =~ worker ]]
then
worker_list+=("${line}")
fi
fi
done < <(ps auxww | awk '/[n]ginx/')
echo "$header"
for line in "${master_list[@]}"
do
echo "${line}"
done
for line in "${worker_list[@]}"
do
echo "${line}"
done
Jump to Line
Something went wrong with that request. Please try again.