mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
shell: use 'command -v' instead of 'hash' (for non-bash)
see https://stackoverflow.com/a/677212
This commit is contained in:
parent
bd26b1b42d
commit
189c3953e7
@ -19,7 +19,7 @@ room=${0##*tinychat_users_}
|
|||||||
##
|
##
|
||||||
if [ "$1" = "autoconf" ]; then
|
if [ "$1" = "autoconf" ]; then
|
||||||
# Check that curl is installed
|
# Check that curl is installed
|
||||||
if hash curl >/dev/null 2>&1; then
|
if command -v curl >/dev/null 2>&1; then
|
||||||
echo "yes"
|
echo "yes"
|
||||||
else
|
else
|
||||||
echo "no (no curl installed)"
|
echo "no (no curl installed)"
|
||||||
|
@ -55,7 +55,7 @@ errordir=${errordir:-/var/spool/nullmailer/failed}
|
|||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
autoconf)
|
autoconf)
|
||||||
if hash nullmailer-queue >/dev/null 2>/dev/null; then
|
if command -v nullmailer-queue >/dev/null 2>/dev/null; then
|
||||||
[ -r "$queuedir" ] && echo yes || echo "no (queue dir not readable)"
|
[ -r "$queuedir" ] && echo yes || echo "no (queue dir not readable)"
|
||||||
else
|
else
|
||||||
echo "no (nullmailer not installed)"
|
echo "no (nullmailer not installed)"
|
||||||
|
@ -78,7 +78,7 @@ case $1 in
|
|||||||
done
|
done
|
||||||
exit 0;;
|
exit 0;;
|
||||||
autoconf)
|
autoconf)
|
||||||
if hash bing 2>/dev/null; then
|
if command -v bing >/dev/null 2>&1; then
|
||||||
echo 'yes'
|
echo 'yes'
|
||||||
exit 0;
|
exit 0;
|
||||||
else
|
else
|
||||||
|
@ -89,7 +89,7 @@ fi
|
|||||||
# real work - i.e. display the data. Almost always this will be
|
# real work - i.e. display the data. Almost always this will be
|
||||||
# "value" subfield for every data field.
|
# "value" subfield for every data field.
|
||||||
|
|
||||||
if hash rabbitmqctl >/dev/null 2>&1; then
|
if command -v rabbitmqctl >/dev/null 2>&1; then
|
||||||
connections=$(HOME=/tmp rabbitmqctl list_connections state | grep -c running)
|
connections=$(HOME=/tmp rabbitmqctl list_connections state | grep -c running)
|
||||||
else
|
else
|
||||||
echo "$0: Could not run rabbitmqctl" >&2
|
echo "$0: Could not run rabbitmqctl" >&2
|
||||||
|
@ -32,7 +32,7 @@ reddit_user=${0##*reddit_karma_}
|
|||||||
##
|
##
|
||||||
if [ "$1" = "autoconf" ]; then
|
if [ "$1" = "autoconf" ]; then
|
||||||
# Check that curl is installed
|
# Check that curl is installed
|
||||||
if hash curl >/dev/null 2>&1; then
|
if command -v curl >/dev/null 2>&1; then
|
||||||
echo "yes"
|
echo "yes"
|
||||||
else
|
else
|
||||||
echo "no (no curl installed)"
|
echo "no (no curl installed)"
|
||||||
|
Loading…
Reference in New Issue
Block a user