initscript: Look for tdbtool/tdbdump using which, not in fixed locations
authorMartin Schwenke <martin@meltin.net>
Tue, 23 Apr 2013 03:49:28 +0000 (13:49 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 6 May 2013 05:40:30 +0000 (15:40 +1000)
Signed-off-by: Martin Schwenke <martin@meltin.net>
config/ctdb.init

index a76b76397668017be380e08fd0f0e3f9b90b500a..013e1ae889bd9f76f5b36b828034337f24317738 100755 (executable)
@@ -130,17 +130,17 @@ select_tdb_checker ()
 {
     # Find the best TDB consistency check available.
     use_tdb_tool_check=false
-    if [ -x /usr/bin/tdbtool ] && \
-       echo "help" | /usr/bin/tdbtool | grep -q check ; then
+    if which tdbtool >/dev/null 2>&1 && \
+       echo "help" | tdbtool | grep -q check ; then
 
        use_tdb_tool_check=true
-    elif [ -x /usr/bin/tdbtool -a -x /usr/bin/tdbdump ] ; then
+    elif which tdbtool >/dev/null 2>&1 && which tdbdump >/dev/null 2>&1 ; then
            do_log <<EOF
 WARNING: The installed 'tdbtool' does not offer the 'check' subcommand.
  Using 'tdbdump' for database checks.
  Consider updating 'tdbtool' for better checks!
 EOF
-    elif [ -x /usr/bin/tdbdump ] ; then
+    elif which tdbdump >/dev/null 2>&1 ; then
        do_log <<EOF
 WARNING: 'tdbtool' is not available.
  Using 'tdbdump' to check the databases.