xref: /original-bsd/libexec/bugfiler/sendbug.sh (revision 0f89e6eb)
1#!/bin/sh -
2#
3# Copyright (c) 1983 Regents of the University of California.
4# All rights reserved.  The Berkeley software License Agreement
5# specifies the terms and conditions for redistribution.
6#
7#	@(#)sendbug.sh	5.4 (Berkeley) 85/08/09
8#
9# Create a bug report and mail to '4bsd-bugs'.
10#
11
12TEMP=/tmp/bug$$
13FORMAT=/usr/ucb/bugformat
14
15# uucp sites should use ": ${BUGADDR=ucbvax!4bsd-bugs}" with a suitable path.
16: ${BUGADDR=4bsd-bugs@BERKELEY.EDU}
17: ${EDITOR=/usr/ucb/vi}
18
19trap '/bin/rm -f $TEMP' 0 1 2 3 13 15
20
21/bin/cp $FORMAT $TEMP
22if $EDITOR $TEMP
23then
24	if cmp -s $FORMAT $TEMP
25	then
26		echo "File not changed, no bug report submitted."
27		exit
28	fi
29	case "$#" in
30	0) /usr/lib/sendmail -t -oi $BUGADDR  < $TEMP ;;
31	*) /usr/lib/sendmail -t -oi "$@" < $TEMP ;;
32	esac
33fi
34