xref: /original-bsd/libexec/bugfiler/sendbug.sh (revision 5fe42eba)
1#!/bin/sh -
2#
3# Copyright (c) 1983, 1993
4#	The Regents of the University of California.  All rights reserved.
5#
6# %sccs.include.redist.sh%
7#
8#	@(#)sendbug.sh	8.1 (Berkeley) 06/04/93
9#
10
11# create a bug report and mail it to '4bsd-bugs'.
12
13PATH=/bin:/sbin:/usr/sbin:/usr/bin
14export PATH
15
16TEMP=/tmp/bug$$
17FORMAT=/usr/share/misc/bugformat
18
19# uucp sites should use ": ${BUGADDR=ucbvax!4bsd-bugs}" with a suitable path.
20: ${BUGADDR=4bsd-bugs@CS.Berkeley.EDU}
21: ${EDITOR=vi}
22
23trap 'rm -f $TEMP ; exit 1' 1 2 3 13 15
24
25cp $FORMAT $TEMP
26chmod u+w $TEMP
27if $EDITOR $TEMP
28then
29	if cmp -s $FORMAT $TEMP
30	then
31		echo "File not changed, no bug report submitted."
32		exit
33	fi
34	case "$#" in
35	0) sendmail -t -oi $BUGADDR  < $TEMP ;;
36	*) sendmail -t -oi "$@" < $TEMP ;;
37	esac
38fi
39
40rm -f $TEMP
41