makeinfo.sh revision 64565
140036Smsmith#!/bin/sh
240036Smsmith#
340036Smsmith# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
440036Smsmith#	All rights reserved.
540036Smsmith# Copyright (c) 1983 Eric P. Allman.  All rights reserved.
640036Smsmith# Copyright (c) 1988, 1993
740036Smsmith#	The Regents of the University of California.  All rights reserved.
840036Smsmith#
940036Smsmith# By using this file, you agree to the terms and conditions set
1040036Smsmith# forth in the LICENSE file which can be found at the top level of
1140036Smsmith# the sendmail distribution.
1240036Smsmith#
1340036Smsmith#
1440036Smsmith#	$Id: makeinfo.sh,v 8.14 1999/02/07 07:26:25 gshapiro Exp $
1540036Smsmith#
1640036Smsmith# $FreeBSD: head/contrib/sendmail/cf/sh/makeinfo.sh 64565 2000-08-12 22:19:16Z gshapiro $
1740036Smsmith#
1840036Smsmith
1940036Smsmithusewhoami=0
2040036Smsmithusehostname=0
2140036Smsmithfor p in `echo $PATH | sed 's/:/ /g'`
2240036Smsmithdo
2340036Smsmith	if [ "x$p" = "x" ]
2440036Smsmith	then
2540036Smsmith		p="."
2640036Smsmith	fi
2740036Smsmith	if [ -f $p/whoami ]
2840036Smsmith	then
2940036Smsmith		usewhoami=1
3040036Smsmith		if [ $usehostname -ne 0 ]
3140036Smsmith		then
3240036Smsmith			break;
3340036Smsmith		fi
3440036Smsmith	fi
3584221Sdillon	if [ -f $p/hostname ]
3684221Sdillon	then
3784221Sdillon		usehostname=1
3840036Smsmith		if [ $usewhoami -ne 0 ]
3940036Smsmith		then
4040036Smsmith			break;
4140036Smsmith		fi
4240036Smsmith	fi
4340036Smsmithdone
4440036Smsmithif [ $usewhoami -ne 0 ]
4540036Smsmiththen
4640036Smsmith	user=`whoami`
4740036Smsmithelse
4840036Smsmith	user=$LOGNAME
4940036Smsmithfi
5040036Smsmith
5140036Smsmithif [ $usehostname -ne 0 ]
5240036Smsmiththen
5340036Smsmith	host=`hostname`
5440036Smsmithelse
5540036Smsmith	host=`uname -n`
5640036Smsmithfi
5740036Smsmithecho '#####' built by $user@$host on `LC_TIME=C date`
5840036Smsmithecho '#####' in `pwd` | sed 's/\/tmp_mnt//'
5940036Smsmithecho '#####' using $1 as configuration include directory | sed 's/\/tmp_mnt//'
6040036Smsmithecho "define(\`__HOST__', $host)dnl"
6140036Smsmith