shift
fi
- [ -z "${mysql_cmd}" ] && mysql_cmd="$(which mysql)"
+ [ -z "${mysql_cmd}" ] && mysql_cmd="$(which mysql 2>/dev/null || command -v mysql 2>/dev/null)"
if [ ${#mysql_opts[@]} -eq 0 ]
then
# try to find the postqueue executable
if [ -z "$postfix_postqueue" -o ! -x "$postfix_postqueue" ]
then
- postfix_postqueue="`which postqueue 2>/dev/null`"
+ postfix_postqueue="$(which postqueue 2>/dev/null || command -v postqueue 2>/dev/null)"
fi
if [ -z "$postfix_postqueue" -o ! -x "$postfix_postqueue" ]
if [ $? -ne 0 ]
then
echo >&2 "Adding netdata user account ..."
- run useradd -r -g netdata -c netdata -s $(which nologin || echo '/bin/false') -d / netdata
+ run useradd -r -g netdata -c netdata -s $(which nologin 2>/dev/null || command -v nologin 2>/dev/null || echo '/bin/false') -d / netdata
fi
getent group docker > /dev/null
# the fping binary to use
# we need one that can output netdata friendly info
-fping="$(which fping || command -v fping)"
+fping="$(which fping 2>/dev/null || command -v fping 2>/dev/null )"
# a space separated list of hosts to fping
hosts=""
# no need for shebang - this file is included from other scripts
-LOOPSLEEP_DATE="$(which date)"
+LOOPSLEEP_DATE="$(which date 2>/dev/null || command -v date 2>/dev/null)"
if [ -z "$LOOPSLEEP_DATE" ]
then
echo >&2 "$0: ERROR: Cannot find the command 'date' in the system path."
[ -z "$plugins_dir" ] && plugins_dir="$( dirname $PROGRAM_FILE )"
config_dir=${NETDATA_CONFIG_DIR-/etc/netdata}
-tc="$(which tc 2>/dev/null)"
+tc="$(which tc 2>/dev/null || command -v tc 2>/dev/null)"
fireqos_run_dir="/var/run/fireqos"
qos_get_class_names_every=120
qos_exit_every=3600