Fixed behaviour of exiwhat when no config. Fixes: #497
[exim.git] / src / src / exiwhat.src
index 77d7f16b96cde4bb80432f8cf56a114c2b2633c0..c5bb312bb61bf148b9aec409eb047047887207c4 100644 (file)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $Cambridge: exim/src/src/exiwhat.src,v 1.1 2004/10/07 10:39:01 ph10 Exp $
+# $Cambridge: exim/src/src/exiwhat.src,v 1.3 2009/01/02 16:58:05 nm4 Exp $
 
 # Copyright (c) 2003 University of Cambridge.
 # See the file NOTICE for conditions of use and distribution.
@@ -75,6 +75,12 @@ while [ "$config" = "" -a $# -gt 0 ] ; do
   shift
 done
 
+# check we have a config file
+if [ "$config" = "" -o ! -f "$config" ]; then
+  echo Config file not found.
+  exit 1
+fi
+
 # Determine where the spool directory is. Search for an exim_path setting
 # in the configure file; otherwise use the bin directory. Call that version of
 # Exim to find the spool directory. BEWARE: a tab character is needed in the
@@ -109,7 +115,7 @@ fi
 # Solaris, "killall" kills ALL processes - this is the System V version of this
 # command, and not what we want!
 
-if [ "$multikill_cmd" != "" ] ; then
+if [ "$multikill_cmd" != "" ] && type "$multikill_cmd" >/dev/null 2>&1; then
   $multikill_cmd $signal "$multikill_arg"
 
 # No multikill command; do it the hard way