changed default address to 4bsd-bugs@berkeley.edu, and
[unix-history] / usr / src / libexec / bugfiler / sendbug.sh
index ce352a6..27248ed 100644 (file)
@@ -1,24 +1,33 @@
-#!/bin/csh -f
+#!/bin/sh -
 #
 # Copyright (c) 1983 Regents of the University of California.
 # All rights reserved.  The Berkeley software License Agreement
 # specifies the terms and conditions for redistribution.
 #
 #
 # Copyright (c) 1983 Regents of the University of California.
 # All rights reserved.  The Berkeley software License Agreement
 # specifies the terms and conditions for redistribution.
 #
-#      @(#)sendbug.sh  5.2 (Berkeley) %G%
+#      @(#)sendbug.sh  5.4 (Berkeley) 85/08/09
 #
 # Create a bug report and mail to '4bsd-bugs'.
 #
 # Create a bug report and mail to '4bsd-bugs'.
+#
+
+TEMP=/tmp/bug$$
+FORMAT=/usr/ucb/bugformat
+
+# uucp sites should use ": ${BUGADDR=ucbvax!4bsd-bugs}" with a suitable path.
+: ${BUGADDR=4bsd-bugs@BERKELEY.EDU}
+: ${EDITOR=/usr/ucb/vi}
 
 
-onintr clean
-/bin/cp /usr/ucb/bugformat /tmp/bug$$
-if ( ! $?EDITOR ) then
-       set EDITOR = /usr/ucb/vi
-endif
-$EDITOR /tmp/bug$$
-if ($#argv == 0) then
-       /usr/lib/sendmail -t 4bsd-bugs\@BERKELEY < /tmp/bug$$
-else
-       /usr/lib/sendmail -t $argv[1] < /tmp/bug$$
-endif
+trap '/bin/rm -f $TEMP' 0 1 2 3 13 15
 
 
-clean:
-/bin/rm -f /tmp/bug$$
+/bin/cp $FORMAT $TEMP
+if $EDITOR $TEMP
+then
+       if cmp -s $FORMAT $TEMP
+       then
+               echo "File not changed, no bug report submitted."
+               exit
+       fi
+       case "$#" in
+       0) /usr/lib/sendmail -t -oi $BUGADDR  < $TEMP ;;
+       *) /usr/lib/sendmail -t -oi "$@" < $TEMP ;;
+       esac
+fi