xref: /onnv-gate/usr/src/cmd/sendmail/cf/sh/makeinfo.sh (revision 6562:53563fcf544b)
10Sstevel@tonic-gate#!/bin/sh
20Sstevel@tonic-gate#
30Sstevel@tonic-gate# Copyright (c) 1983 Eric P. Allman
40Sstevel@tonic-gate# Copyright (c) 1988, 1993
50Sstevel@tonic-gate#	The Regents of the University of California.  All rights reserved.
60Sstevel@tonic-gate#
7*6562Sjbeck# Copyright 1998, 2007 Sun Microsystems, Inc.  All rights reserved.
8*6562Sjbeck# Use is subject to license terms.
90Sstevel@tonic-gate#
100Sstevel@tonic-gate# Redistribution and use in source and binary forms, with or without
110Sstevel@tonic-gate# modification, are permitted provided that the following conditions
120Sstevel@tonic-gate# are met:
130Sstevel@tonic-gate# 1. Redistributions of source code must retain the above copyright
140Sstevel@tonic-gate#    notice, this list of conditions and the following disclaimer.
150Sstevel@tonic-gate# 2. Redistributions in binary form must reproduce the above copyright
160Sstevel@tonic-gate#    notice, this list of conditions and the following disclaimer in the
170Sstevel@tonic-gate#    documentation and/or other materials provided with the distribution.
180Sstevel@tonic-gate# 3. All advertising materials mentioning features or use of this software
190Sstevel@tonic-gate#    must display the following acknowledgement:
200Sstevel@tonic-gate#	This product includes software developed by the University of
210Sstevel@tonic-gate#	California, Berkeley and its contributors.
220Sstevel@tonic-gate# 4. Neither the name of the University nor the names of its contributors
230Sstevel@tonic-gate#    may be used to endorse or promote products derived from this software
240Sstevel@tonic-gate#    without specific prior written permission.
250Sstevel@tonic-gate#
260Sstevel@tonic-gate# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
270Sstevel@tonic-gate# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
280Sstevel@tonic-gate# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
290Sstevel@tonic-gate# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
300Sstevel@tonic-gate# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
310Sstevel@tonic-gate# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
320Sstevel@tonic-gate# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
330Sstevel@tonic-gate# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
340Sstevel@tonic-gate# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
350Sstevel@tonic-gate# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
360Sstevel@tonic-gate# SUCH DAMAGE.
370Sstevel@tonic-gate#
380Sstevel@tonic-gate#	%W% (Berkeley+Sun) %G%
390Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
400Sstevel@tonic-gate#
410Sstevel@tonic-gate
420Sstevel@tonic-gateif [ "x$1" = "x-q" ]
430Sstevel@tonic-gatethen
440Sstevel@tonic-gate	quiet=1
450Sstevel@tonic-gate	shift
460Sstevel@tonic-gateelse
470Sstevel@tonic-gate	quiet=0
480Sstevel@tonic-gatefi
490Sstevel@tonic-gate
500Sstevel@tonic-gateusewhoami=0
510Sstevel@tonic-gateusehostname=0
520Sstevel@tonic-gatefor p in `echo $PATH | sed 's/:/ /g'`
530Sstevel@tonic-gatedo
540Sstevel@tonic-gate	if [ "x$p" = "x" ]
550Sstevel@tonic-gate	then
560Sstevel@tonic-gate		p="."
570Sstevel@tonic-gate	fi
580Sstevel@tonic-gate	if [ -f $p/whoami ]
590Sstevel@tonic-gate	then
600Sstevel@tonic-gate		usewhoami=1
610Sstevel@tonic-gate		if [ $usehostname -ne 0 ]
620Sstevel@tonic-gate		then
630Sstevel@tonic-gate			break;
640Sstevel@tonic-gate		fi
650Sstevel@tonic-gate	fi
660Sstevel@tonic-gate	if [ -f $p/hostname ]
670Sstevel@tonic-gate	then
680Sstevel@tonic-gate		usehostname=1
690Sstevel@tonic-gate		if [ $usewhoami -ne 0 ]
700Sstevel@tonic-gate		then
710Sstevel@tonic-gate			break;
720Sstevel@tonic-gate		fi
730Sstevel@tonic-gate	fi
740Sstevel@tonic-gatedone
750Sstevel@tonic-gateif [ $usewhoami -ne 0 ]
760Sstevel@tonic-gatethen
770Sstevel@tonic-gate	user=`whoami`
780Sstevel@tonic-gateelse
790Sstevel@tonic-gate	user=$LOGNAME
800Sstevel@tonic-gatefi
810Sstevel@tonic-gate
820Sstevel@tonic-gateif [ $usehostname -ne 0 ]
830Sstevel@tonic-gatethen
840Sstevel@tonic-gate	host=`hostname`
850Sstevel@tonic-gateelse
860Sstevel@tonic-gate	host=`uname -n`
870Sstevel@tonic-gatefi
880Sstevel@tonic-gateif [ $quiet -eq 1 ]
890Sstevel@tonic-gatethen
900Sstevel@tonic-gate	echo '#####' built on `date`
910Sstevel@tonic-gateelse
92*6562Sjbeck	if [ -n "$user" ]; then
93*6562Sjbeck		echo '#####' built by $user@$host on `date`
94*6562Sjbeck	else
95*6562Sjbeck		echo '#####' built automatically @$host on `date`
96*6562Sjbeck	fi
970Sstevel@tonic-gate	echo '#####' in `pwd` | sed 's/\/tmp_mnt//'
980Sstevel@tonic-gate	echo '#####' using $1 as configuration include directory | sed 's/\/tmp_mnt//'
990Sstevel@tonic-gate	echo "define(\`__HOST__', $host)dnl"
1000Sstevel@tonic-gatefi
101