make sure the file's writeable
[unix-history] / usr / src / libexec / bugfiler / sendbug.sh
CommitLineData
9725ee58 1#!/bin/sh -
6dbbb852 2#
741386bd 3# Copyright (c) 1983 The Regents of the University of California.
aec2eff2 4# All rights reserved.
7172eb74 5#
741386bd 6# %sccs.include.redist.sh%
6dbbb852 7#
a0816831 8# @(#)sendbug.sh 5.11 (Berkeley) %G%
9725ee58 9#
741386bd
KB
10
11# create a bug report and mail it to '4bsd-bugs'.
9725ee58 12
435e8dff
KB
13PATH=/bin:/sbin:/usr/sbin:/usr/bin
14export PATH
15
9725ee58 16TEMP=/tmp/bug$$
435e8dff 17FORMAT=/usr/share/misc/bugformat
9725ee58 18
e70420db
RE
19# uucp sites should use ": ${BUGADDR=ucbvax!4bsd-bugs}" with a suitable path.
20: ${BUGADDR=4bsd-bugs@BERKELEY.EDU}
435e8dff 21: ${EDITOR=vi}
6dbbb852 22
435e8dff 23trap 'rm -f $TEMP ; exit 1' 1 2 3 13 15
055d98e6 24
435e8dff 25cp $FORMAT $TEMP
a0816831 26chmod u+w $TEMP
9725ee58
RE
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
435e8dff
KB
35 0) sendmail -t -oi $BUGADDR < $TEMP ;;
36 *) sendmail -t -oi "$@" < $TEMP ;;
9725ee58
RE
37 esac
38fi
e1c2388a 39
435e8dff 40rm -f $TEMP