X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/059ec3d9952740285fb1ebf47961b8aca2eb1b4a..d945e180cbe2b26392fb21f7ae4dd2ccc603a81b:/src/src/exiwhat.src diff --git a/src/src/exiwhat.src b/src/src/exiwhat.src index 77d7f16b9..425e789ad 100644 --- a/src/src/exiwhat.src +++ b/src/src/exiwhat.src @@ -1,8 +1,9 @@ #! /bin/sh -# $Cambridge: exim/src/src/exiwhat.src,v 1.1 2004/10/07 10:39:01 ph10 Exp $ -# Copyright (c) 2003 University of Cambridge. +# Copyright (c) The Exim Maintainers 2023 +# Copyright (c) University of Cambridge, 1995 - 2007 # See the file NOTICE for conditions of use and distribution. +# SPDX-License-Identifier: GPL-2.0-or-later # Except when they appear in comments, the following placeholders in this # source are replaced when it is turned into a runnable script: @@ -16,6 +17,7 @@ # EXIWHAT_EGREP_ARG # EXIWHAT_MULTIKILL_CMD # EXIWHAT_MULTIKILL_ARG +# RM_COMMAND # PROCESSED_FLAG @@ -30,6 +32,8 @@ # the script in the next Exim rebuild/install. However, it's best to # arrange your build-time configuration file to get the correct values. +rm=RM_COMMAND + # Some operating systems have a command that finds processes that match # certain conditions (by default usually those running specific commands) # and sends them signals. If such a command is defined for your OS, the @@ -53,6 +57,13 @@ signal=EXIWHAT_KILL_SIGNAL # See if this installation is using the esoteric "USE_NODE" feature of Exim, # in which it uses the host's name as a suffix for the configuration file name. +if [ "x$1" = x--version -o "x$1" = x-v ] +then + echo "`basename $0`: $0" + echo "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION" + exit 0 +fi + if [ "CONFIGURE_FILE_USE_NODE" = "yes" ]; then hostsuffix=.`uname -n` fi @@ -75,6 +86,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 @@ -98,7 +115,7 @@ fi # Now do the job. -/bin/rm -f ${log} +$rm -f ${log} if [ -f ${log} ]; then echo "** Failed to remove ${log}" exit 1 @@ -109,7 +126,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 @@ -124,7 +141,7 @@ fi sleep 1 if [ ! -s ${log} ] ; then echo "No exim process data" ; - else sed 's/^[0-9-]* [0-9:]* \([+-][0-9]* \)*//' ${log} | sort -n | uniq ; fi + else sort -nu ${log} ; fi # End of exiwhat