summaryrefslogtreecommitdiffstats
path: root/charts.d
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-10-29 00:47:14 +0300
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-10-29 00:47:14 +0300
commit04e90b1930fc324b2d767e6cac03edc8be045c27 (patch)
treed7877bb992003bb238411d699e70cb33fd4d1975 /charts.d
parente903222bd9f2403f38c6b74b2521cd576b5420e5 (diff)
use which or command -v to search for commands in the system path
Diffstat (limited to 'charts.d')
-rwxr-xr-xcharts.d/mysql.chart.sh2
-rwxr-xr-xcharts.d/postfix.chart.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/charts.d/mysql.chart.sh b/charts.d/mysql.chart.sh
index 86feac997c..1363d01f42 100755
--- a/charts.d/mysql.chart.sh
+++ b/charts.d/mysql.chart.sh
@@ -55,7 +55,7 @@ mysql_check() {
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
diff --git a/charts.d/postfix.chart.sh b/charts.d/postfix.chart.sh
index 8106414a1f..85604fcbe2 100755
--- a/charts.d/postfix.chart.sh
+++ b/charts.d/postfix.chart.sh
@@ -23,7 +23,7 @@ postfix_check() {
# 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" ]