head 1.17; access; symbols; locks; strict; comment @# @; 1.17 date 99.04.28.11.09.16; author alexis; state Exp; branches; next 1.16; 1.16 date 99.02.20.18.09.41; author alexis; state Exp; branches; next 1.15; 1.15 date 99.01.07.13.19.09; author alexis; state Exp; branches; next 1.14; 1.14 date 98.08.31.12.43.58; author alexis; state Exp; branches; next 1.13; 1.13 date 98.08.28.17.41.13; author alexis; state Exp; branches; next 1.12; 1.12 date 98.08.28.13.40.04; author alexis; state Exp; branches; next ; desc @SHPP PORT OF announce.in 1.11 @ 1.17 log @split 'pending disconnections cancelled, connection will go down in 20 mins' into two separate messages - this simplified dhuy. @ text @#!MARKER_SHELL_CMD PATH=/bin:/usr/bin PROGNAME=`basename $0` ############################################################################### # # # LINK STATUS REPORTER # # # ############################################################################### ############################################################################### # # Things you should know about this script: # # It is stored under RCS! Keep it that way! If you want a history of # changes made to this script then refer to rlog(1) - don't look here! # ############################################################################### ############################################################################### # # CONFIGURABLE STUFF STARTS HERE # ############################################################################### COUNT=5 ############################################################################### # # CONFIGURABLE STUFF ENDS HERE # ############################################################################### VERSION="MARKER_PATCHLEVEL" # $Header: /diskb/home/alexis/dev/supported/ppplc/lib/misc/RCS/announce.shpp,v 1.16 1999/02/20 18:09:41 alexis Exp alexis $ ############################################################################### # # MAIN FUNCTION (called from very bottom of script) # ############################################################################### main() { ########################################################################### # # PROCESS OPTIONS # ########################################################################### MODE=unset while [ "X$1" != X ]; do case "$1" in -V) echo "$PROGNAME version $VERSION" exit 0 ;; -d) [ "X$2" = X ] && usage VERBOSE_LEVEL=$2 shift ;; -v) VERBOSE_LEVEL=3 ;; -b) BEEP=yes ;; -w) MODE=wall ;; -e) MODE=echo ;; -*) usage ;; *) break ;; esac shift done # One argument required - the host to use for the check [ "X$1" = X -o "X$2" != X ] && usage [ $MODE = unset ] && usage # Are locks required? No. This script should run very quickly. ########################################################################### # # ANNOUNCE IT! # ########################################################################### case "$1" in 0) MSG="INTERNET CONNECTION UP" ;; 1) MSG="INTERNET CONNECTION DOWN - BAD QUALITY - REDIALLING" ;; 2) MSG="INTERNET CONNECTION DOWN - BAD QUALITY - NOT REDIALLING" ;; 3) MSG="INTERNET CONNECTION DOWN - REMOTE HANGUP - REDIALLING" ;; 4) MSG="INTERNET CONNECTION DOWN - REMOTE HANGUP - NOT REDIALLING" ;; 5) MSG="INTERNET CONNECTION DOWN - LOCALLY DETECTED IDLE - NOT REDIALLING" ;; 6) MSG="INTERNET CONNECTION DOWN - USER REQUEST - NOT REDIALLING" ;; 7) MSG="INTERNET CONNECTION WILL GO DOWN IN 5 MINUTES" ;; 8) MSG="INTERNET CONNECTION WILL GO DOWN IN 20 MINUTES" ;; 9) MSG="PENDING DISCONNECTIONS CANCELLED" ;; *) internal "unknown announcement id ($1)" ;; esac [ "X$BEEP" = Xyes ] && MSG="${MSG}" case $MODE in wall) wall < | -v ] { -e | -w } { 0 | 1 | 2 | 3 | 4 | 5 | 6 }" echo " $PROGNAME -V" } >&2 exit 1 } #shpp include utils.sh.shpp #shpp include gep.sh.shpp @ 1.16 log @removed lockfile generator (not used). @ text @d35 1 a35 1 # $Header: /diskb/home/alexis/dev/supported/ppplc/lib/misc/RCS/announce.shpp,v 1.15 1999/01/07 13:19:09 alexis Exp alexis $ d91 2 a92 1 8) MSG="PENDING DISCONNECTIONS CANCELLED, INTERNET CONNECTION WILL NOW GO DOWN IN 20 MINUTES" ;; d123 1 @ 1.15 log @symbol name changes @ text @d35 1 a35 1 # $Header: announce.shpp,v 1.14 1998/08/31 12:43:58 alexis Exp alexis $ a109 5 } gen_lock_file_name() { echo MARKER_LOCK_DIR/$PROGNAME.pid @ 1.14 log @clarified message text for mesaage 8 @ text @d1 1 a1 1 #!SCRIPTSHELLCMD_MARKER d34 2 a35 2 VERSION="PATCHLEVEL_MARKER" # $Id: announce.shpp,v 1.13 1998/08/28 17:41:13 alexis Exp alexis $ d114 1 a114 1 echo LOCK_DIR_MARKER/$PROGNAME.pid d126 1 a126 1 #shpp include utils.sh @ 1.13 log @removed version number tests @ text @d35 1 a35 1 # $Id: announce.shpp,v 1.12 1998/08/28 13:40:04 alexis Exp alexis $ d91 1 a91 1 8) MSG="INTERNET CONNECTION WILL GO DOWN IN 20 MINUTES" ;; @ 1.12 log @*** empty log message *** @ text @d35 1 a35 1 # $Id: announce.in,v 1.11 1998/08/27 15:38:42 alexis Exp alexis $ d55 2 a56 7 -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 ;; d114 1 a114 1 echo LOCKDIR_MARKER/$PROGNAME.pid @