Merge from vendor branch SENDMAIL:
[dragonfly.git] / contrib / sendmail-8.13.7 / cf / sh / makeinfo.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
4 #       All rights reserved.
5 # Copyright (c) 1983 Eric P. Allman.  All rights reserved.
6 # Copyright (c) 1988, 1993
7 #       The Regents of the University of California.  All rights reserved.
8 #
9 # By using this file, you agree to the terms and conditions set
10 # forth in the LICENSE file which can be found at the top level of
11 # the sendmail distribution.
12 #
13 #
14 #       $Id: makeinfo.sh,v 8.14 1999/02/07 07:26:25 gshapiro Exp $
15 #
16
17 usewhoami=0
18 usehostname=0
19 for p in `echo $PATH | sed 's/:/ /g'`
20 do
21         if [ "x$p" = "x" ]
22         then
23                 p="."
24         fi
25         if [ -f $p/whoami ]
26         then
27                 usewhoami=1
28                 if [ $usehostname -ne 0 ]
29                 then
30                         break;
31                 fi
32         fi
33         if [ -f $p/hostname ]
34         then
35                 usehostname=1
36                 if [ $usewhoami -ne 0 ]
37                 then
38                         break;
39                 fi
40         fi
41 done
42 if [ $usewhoami -ne 0 ]
43 then
44         user=`whoami`
45 else
46         user=$LOGNAME
47 fi
48
49 if [ $usehostname -ne 0 ]
50 then
51         host=`hostname`
52 else
53         host=`uname -n`
54 fi
55 echo '#####' built by $user@$host on `date`
56 echo '#####' in `pwd` | sed 's/\/tmp_mnt//'
57 echo '#####' using $1 as configuration include directory | sed 's/\/tmp_mnt//'
58 echo "define(\`__HOST__', $host)dnl"