#!/bin/sh # Copyright (c) 2002 Chris Costello # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # Development STatus REPorts. mailaddr="devnull@example.org" stecho() { echo $@ >&3 } tmpfile=$(mktemp -t $(basename $0)) || exit 1 trap "rm ${tmpfile}" EXIT exec 3> ${tmpfile} stecho '' read -p "Project title: " project_title stecho " ${project_title}" stecho " " echo "List project contacts below in the following format:" echo " lastname|firstname|address" echo echo "Example:" echo " Costello|Chris|chris@FreeBSD.org" echo echo "When finished, press ^D." ( IFS='|' while read lastname firstname address crud do if [ -z "${lastname}" -o -z "${firstname}" \ -o -z "${address}" ] then echo >&2 "Please use the specified format." continue fi stecho " " stecho " " stecho " ${lastname}" stecho " ${firstname}" stecho " " stecho " ${address}" stecho " " done ) stecho " " stecho stecho " " echo "List project URLs. When finished, press ^D." ( while read url do stecho " " done ) stecho " " stecho " " echo "Type status report body in HTML below. When finished, press ^D." cat >&3 stecho " " while true do vi ${tmpfile} read -p "Mail report to ${mailaddr}? " mailit_yesno case ${mailit_yesno} in [Yy]*) mailit=yes break ;; *) continue esac done exec 3<&- mail -s "Status report: ${project_title}" ${mailaddr} < ${tmpfile}