]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/sendmail/cf/sh/makeinfo.sh
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / sendmail / 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 # $FreeBSD$
17 #
18
19 usewhoami=0
20 usehostname=0
21 for p in `echo $PATH | sed 's/:/ /g'`
22 do
23         if [ "x$p" = "x" ]
24         then
25                 p="."
26         fi
27         if [ -f $p/whoami ]
28         then
29                 usewhoami=1
30                 if [ $usehostname -ne 0 ]
31                 then
32                         break;
33                 fi
34         fi
35         if [ -f $p/hostname ]
36         then
37                 usehostname=1
38                 if [ $usewhoami -ne 0 ]
39                 then
40                         break;
41                 fi
42         fi
43 done
44 if [ $usewhoami -ne 0 ]
45 then
46         user=`whoami`
47 else
48         user=$LOGNAME
49 fi
50
51 if [ $usehostname -ne 0 ]
52 then
53         host=`hostname`
54 else
55         host=`uname -n`
56 fi
57 echo '#####' built by $user@$host
58 echo '#####' in `pwd` | sed 's/\/tmp_mnt//'
59 echo '#####' using $1 as configuration include directory | sed 's/\/tmp_mnt//'
60 echo "define(\`__HOST__', $host)dnl"