summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorJose A. Rivera <jarrpa@samba.org>2015-06-05 09:20:59 -0500
committerMichael Adam <obnox@samba.org>2015-06-05 20:39:47 +0200
commit7266c68856fab27113aaab5e622d19a76f56ac52 (patch)
treef23ca5390ca24d9ff13cf6d3ac438e3d7951acb2 /ctdb
parenta4db3b30c5a8533943766486f72422a5eb072a62 (diff)
downloadsamba-7266c68856fab27113aaab5e622d19a76f56ac52.tar.gz
ctdb: Change use of 'which' to 'type' in scripts.
While 'which' is a very common tool, on many distros it is not a requirement that it be installed. 'type' is a shell built-in specified by the Open Group, and is found in shells like bash, dash, and ksh across multiple OSes. Signed-off-by: Jose A. Rivera <jarrpa@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri Jun 5 20:39:47 CEST 2015 on sn-devel-104
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/config/events.d/00.ctdb4
-rwxr-xr-xctdb/config/events.d/60.ganesha2
-rwxr-xr-xctdb/config/functions4
3 files changed, 5 insertions, 5 deletions
diff --git a/ctdb/config/events.d/00.ctdb b/ctdb/config/events.d/00.ctdb
index 21ca77be1ff..0e25e501754 100755
--- a/ctdb/config/events.d/00.ctdb
+++ b/ctdb/config/events.d/00.ctdb
@@ -17,8 +17,8 @@ select_tdb_checker ()
{
# Find the best TDB consistency check available.
use_tdb_tool_check=false
- which tdbtool >/dev/null 2>&1 && found_tdbtool=true
- which tdbdump >/dev/null 2>&1 && found_tdbdump=true
+ type tdbtool >/dev/null 2>&1 && found_tdbtool=true
+ type tdbdump >/dev/null 2>&1 && found_tdbdump=true
if $found_tdbtool && echo "help" | tdbtool | grep -q check ; then
use_tdb_tool_check=true
diff --git a/ctdb/config/events.d/60.ganesha b/ctdb/config/events.d/60.ganesha
index fc170983dc5..cd735bef620 100755
--- a/ctdb/config/events.d/60.ganesha
+++ b/ctdb/config/events.d/60.ganesha
@@ -229,7 +229,7 @@ case "$1" in
# For platforms where rpc.statd does not exist, we skip
# the check completely
p="rpc.statd"
- which $p >/dev/null 2>/dev/null && \
+ type $p >/dev/null 2>/dev/null && \
nfs_check_rpc_service "statd" \
% 10 "verbose restart:b unhealthy" \
-ge 6 "verbose unhealthy" \
diff --git a/ctdb/config/functions b/ctdb/config/functions
index 340b1e58f66..ec695830713 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -337,7 +337,7 @@ _nfs_check_rpc_common ()
# Some platforms don't have separate programs for all services.
case "$_prog_name" in
statd)
- which "rpc.${_prog_name}" >/dev/null 2>&1 || return 0
+ type "rpc.${_prog_name}" >/dev/null 2>&1 || return 0
esac
case "$_prog_name" in
@@ -1430,7 +1430,7 @@ iptables_wrapper ()
}
# AIX (and perhaps others?) doesn't have mktemp
-if ! which mktemp >/dev/null 2>&1 ; then
+if ! type mktemp >/dev/null 2>&1 ; then
mktemp ()
{
_dir=false