]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb: Change use of 'which' to 'type' in scripts.
authorJose A. Rivera <jarrpa@samba.org>
Fri, 5 Jun 2015 14:20:59 +0000 (09:20 -0500)
committerMichael Adam <obnox@samba.org>
Fri, 5 Jun 2015 18:39:47 +0000 (20:39 +0200)
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

ctdb/config/events.d/00.ctdb
ctdb/config/events.d/60.ganesha
ctdb/config/functions

index 21ca77be1ff35b2521060de143d405140c1cd790..0e25e50175467002d4382429c21cde3e25a6279d 100755 (executable)
@@ -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
index fc170983dc5a79bc815bb7a95f255cc2554069a9..cd735bef620792d88b29c7e31439a78dde962a05 100755 (executable)
@@ -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" \
index 340b1e58f6668ec76c435a17b62d750cdaeeb3ed..ec695830713d610413b0a47bdb7f37110e9ef418 100755 (executable)
@@ -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