head 1.9; access; symbols; locks; strict; comment @# @; 1.9 date 98.02.05.12.27.22; author alexis; state Exp; branches; next 1.8; 1.8 date 97.11.11.12.16.27; author alexis; state Exp; branches; next 1.7; 1.7 date 97.10.26.18.56.32; author alexis; state Exp; branches; next 1.6; 1.6 date 97.10.26.12.12.34; author alexis; state Exp; branches; next 1.5; 1.5 date 97.10.26.10.14.46; author alexis; state Exp; branches; next 1.4; 1.4 date 97.02.15.11.38.05; author alexis; state Exp; branches; next 1.3; 1.3 date 97.02.15.11.16.26; author alexis; state Exp; branches; next 1.2; 1.2 date 97.01.31.10.22.48; author alexis; state Exp; branches; next 1.1; 1.1 date 97.01.22.10.34.49; author alexis; state Exp; branches; next ; desc @@ 1.9 log @standardised script @ text @#!SCRIPTSHELLCMD_MARKER PROGNAME=`basename $0` # $Id: sndnews.in,v 1.8 1997/11/11 12:16:27 alexis Exp alexis $ VERSION="PATCHLEVEL_MARKER" ############################################################################## # # # DON'T CHANGE ANYTHING BELOW HERE # # # ############################################################################## 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 [ "X$2" != X -o "X$1" = X ] && usage # there must be only 1 argument NEWSHOST=$1 TOGOFILE=`echo TOGOTEMPLATE_MARKER | sed "sŁ%HŁ$NEWSHOSTŁg"` debug 5 "togofile is $TOGOFILE" su - news -c "NEWSBINDIR_MARKER/input/newsrunning on" < /dev/null su - news -c NEWSBINDIR_MARKER/input/newsrun < /dev/null su - news -c "NEWSBINDIR_MARKER/input/newsrunning off" < /dev/null su - news -c "XMITNEWSCMD_MARKER -d -h $NEWSHOST -f $TOGOFILE" < /dev/null su - news -c "NEWSBINDIR_MARKER/input/newsrunning on" < /dev/null } 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.8 log @standardised! (functions,compiling.markers) @ text @d3 1 a3 1 # $Id: shell-script,v 1.1 1997/10/26 22:44:12 alexis Exp $ d23 1 a23 2 VERBOSE_LEVEL=2 d43 1 a43 1 [ "X$1" = X -o "X$2" != X ] && usage d62 1 d90 1 d98 1 d101 10 a110 2 [ $VERBOSE_LEVEL -ge $1 ] && { shift; echo "$PROGNAME: \ DEBUG: $*"; } d114 1 a118 2 COLOUR_REQUESTED=false a120 1 -c) COLOUR_REQUESTED=true ;; d127 3 a129 3 if [ $COLOUR_REQUESTED = true -a $HONOUR_COLOUR_REQUESTS = true ]; then echo "$BROWN$PROGNAME: \ INFO: $*$WHITE" @ 1.7 log @continued directory reorganisation @ text @d1 3 a3 1 #!/bin/sh a4 1 { expr $VERSION : 'P.*R' > /dev/null; } && VERSION="`echo '$Id: sndnews.in,v 1.6 1997/10/26 12:12:34 alexis Exp alexis $' | cut -f3 -d' '` (development)" d6 126 a131 5 su - news -c "NEWSBINDIR_MARKER/input/newsrunning on" < /dev/null su - news -c NEWSBINDIR_MARKER/input/newsrun < /dev/null su - news -c "NEWSBINDIR_MARKER/input/newsrunning off" < /dev/null su - news -c "/usr/local/lib/nntp/xmitnews -d -h news.demon.co.uk -f /var/spool/news/out.going/news.demon.co.uk/togo" < /dev/null su - news -c "NEWSBINDIR_MARKER/input/newsrunning on" < /dev/null @ 1.6 log @stamped for release 1.0.6 @ text @d3 1 a3 1 { expr $VERSION : 'P.*R' > /dev/null; } && VERSION="`echo '$Id: sndnews.in,v 1.5 1997/10/26 10:14:46 alexis Exp alexis $' | cut -f3 -d' '` (development)" d5 3 a7 3 su - news -c "NEWLCLSBINDIR_MARKER/input/newsrunning on" < /dev/null su - news -c NEWLCLSBINDIR_MARKER/input/newsrun < /dev/null su - news -c "NEWLCLSBINDIR_MARKER/input/newsrunning off" < /dev/null d9 1 a9 1 su - news -c "NEWLCLSBINDIR_MARKER/input/newsrunning on" < /dev/null @ 1.5 log @step @ text @d3 1 a3 1 { expr $VERSION : 'P.*R' > /dev/null; } && VERSION="`echo '$Id: sndnews,v 1.4 1997/02/15 11:38:05 alexis Exp alexis $' | cut -f3 -d' '` (development)" @ 1.4 log @improved version info @ text @d3 1 a3 1 { expr $VERSION : 'P.*R' > /dev/null; } && VERSION="`echo '$Id$' | cut -f3 -d' '` (development)" d5 3 a7 3 su - news -c "/usr/lib/newsbin/input/newsrunning on" < /dev/null su - news -c /usr/lib/newsbin/input/newsrun < /dev/null su - news -c "/usr/lib/newsbin/input/newsrunning off" < /dev/null d9 1 a9 1 su - news -c "/usr/lib/newsbin/input/newsrunning on" < /dev/null @ 1.3 log @incoming batches now flushed. (outgoing articles *are* incoming batches! ) @ text @d2 2 @ 1.2 log @WORKING MILESTONE @ text @d3 2 @ 1.1 log @Initial revision @ text @d3 3 a5 2 /usr/lib/newsbin/input/newsrunning off exec /usr/local/lib/nntp/xmitnews -d -h news.demon.co.uk -f /var/spool/news/out.going/news.demon.co.uk/togo @