head 1.5; access; symbols; locks; strict; comment @# @; 1.5 date 98.02.05.12.27.22; author alexis; state Exp; branches; next 1.4; 1.4 date 97.11.11.12.18.21; author alexis; state Exp; branches; next 1.3; 1.3 date 97.10.26.12.12.33; author alexis; state Exp; branches; next 1.2; 1.2 date 97.02.15.11.41.27; author alexis; state Exp; branches; next 1.1; 1.1 date 97.01.22.10.34.37; author alexis; state Exp; branches; next ; desc @@ 1.5 log @standardised script @ text @#!SCRIPTSHELLCMD_MARKER PATH=/bin:/usr/bin PROGNAME=`basename $0` VERSION="PATCHLEVEL_MARKER" # $Id: getmail.in,v 1.4 1997/11/11 12:18:21 alexis Exp alexis $ usage() { { echo "Usage: $PROGNAME [ -d | -v ]" echo " $PROGNAME -V" } >&2 exit 2 } main() { # Process options - author to add extra options! while [ "X$1" != X ]; do case "$1" in -V) if expr "$VERSION" : 'P.*R$' > /dev/null; then warning "this is a development version; use 'ident' for version information" exit 1 else echo "$PROGNAME version $VERSION" exit 0 fi ;; -d) [ "X$2" = X ] && usage VERBOSE_LEVEL=$2 shift ;; -v) VERBOSE_LEVEL=3 ;; -*) usage ;; *) break ;; esac shift done # Nothing to do! This script was written for an SMTP environment. # As such, mail is *sent by the remote site*, not *retrieved by the # local one*. [ "X$1" != X ] && usage # there must be no arguments } internal() { echo "$PROGNAME: \ INTERNAL ERROR: $*" exit 2 } VERBOSE_LEVEL=${VERBOSE_LEVEL:-2} error() { FATAL=false while :; do case "$1" in -f) FATAL=true ;; -*) internal "invalid option to error() '$1'" ;; *) break ;; esac shift done if [ $VERBOSE_LEVEL -ge 1 ]; then if [ $FATAL = true ]; then echo "$PROGNAME: \ FATAL ERROR: $*" >&2 else echo "$PROGNAME: \ ERROR: $*" >&2 fi fi [ $FATAL = true ] && exit 1 return 1 } VERBOSE_LEVEL=${VERBOSE_LEVEL:-2} warning() { [ $VERBOSE_LEVEL -ge 2 ] && { echo "$PROGNAME: \ WARNING: $*" >&2; } return 0 } VERBOSE_LEVEL=${VERBOSE_LEVEL:-2} debug() { if [ $VERBOSE_LEVEL -ge $1 ]; then shift if [ "X$MSG_HANDLE" = Xstderr ]; then echo "$PROGNAME: \ DEBUG: $*" >&2 else echo "$PROGNAME: \ DEBUG: $*" fi fi return 0 } VERBOSE_LEVEL=${VERBOSE_LEVEL:-2} info() { [ $VERBOSE_LEVEL -lt 3 ] && return while :; do case "$1" in -*) internal "invalid option to info() '$1'" ;; *) break ;; esac shift done if [ "X$MSG_HANDLE" = Xstderr ]; then echo "$PROGNAME: \ INFO: $*" >&2 else echo "$PROGNAME: \ INFO: $*" fi return 0 } umask 022 main "$@@" exit $? @ 1.4 log @standardised! (markers,functions,compiling) @ text @d5 1 a5 1 # $Id$ d9 2 a10 2 { echo "Usage: $PROGNAME" d13 1 a13 1 exit 1 d18 1 d21 11 a31 2 -V) echo "$PROGNAME version $VERSION" exit 0 ;; a36 1 d40 84 @ 1.3 log @stamped for release 1.0.6 @ text @d1 3 a3 1 #!/bin/sh d5 1 a5 1 { expr $VERSION : 'P.*R' > /dev/null; } && VERSION="`echo '$Id: getmail,v 1.2 1997/02/15 11:41:27 alexis Exp alexis $' | cut -f3 -d' '` (development)" d7 8 d16 20 a35 1 exit 0 @ 1.2 log @improved version info @ text @d3 1 a3 1 { expr $VERSION : 'P.*R' > /dev/null; } && VERSION="`echo '$Id$' | cut -f3 -d' '` (development)" @ 1.1 log @Initial revision @ text @d2 4 @