@cryptotaxi247 / netdata-1 / commits / 19b65f376

added portable pidod

Costa Tsaousis (ktsaou) committed Jan 3, 2018 at 07:39 UTC 19b65f376b0806fc24e928188f8a8bb03e6f58fd
1 file changed +18
installer/functions.sh
+18
@@ -141,6 +141,24 @@ service() {
141 return 1
142 }
143
144 +# -----------------------------------------------------------------------------
145 +# portable pidof
146 +
147 +pidof_cmd="$(which_cmd pidof)"
148 +pidof() {
149 + if [ ! -z "${pidof_cmd}" ]
150 + then
151 + ${pidof_cmd} "${@}"
152 + return $?
153 + else
154 + ps -acxo pid,comm |\
155 + sed "s/^ *//g" |\
156 + grep netdata |\
157 + cut -d ' ' -f 1
158 + return $?
159 + fi
160 +}
161 +
162 # -----------------------------------------------------------------------------
163
164 run_ok() {