summaryrefslogtreecommitdiffstats
path: root/installer
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2018-01-03 07:39:50 +0200
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2018-01-03 07:39:50 +0200
commit19b65f376b0806fc24e928188f8a8bb03e6f58fd (patch)
tree1079bb2320db112ed72a6775209f0c7b4f8192c9 /installer
parentb4c2b536d4a618ce85a4af5b50993dbb228325d9 (diff)
added portable pidod
Diffstat (limited to 'installer')
-rw-r--r--installer/functions.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/installer/functions.sh b/installer/functions.sh
index d403bfe520..765f1f134f 100644
--- a/installer/functions.sh
+++ b/installer/functions.sh
@@ -142,6 +142,24 @@ service() {
}
# -----------------------------------------------------------------------------
+# portable pidof
+
+pidof_cmd="$(which_cmd pidof)"
+pidof() {
+ if [ ! -z "${pidof_cmd}" ]
+ then
+ ${pidof_cmd} "${@}"
+ return $?
+ else
+ ps -acxo pid,comm |\
+ sed "s/^ *//g" |\
+ grep netdata |\
+ cut -d ' ' -f 1
+ return $?
+ fi
+}
+
+# -----------------------------------------------------------------------------
run_ok() {
printf >&2 "${TPUT_BGGREEN}${TPUT_WHITE}${TPUT_BOLD} OK ${TPUT_RESET} ${*} \n\n"