head 1.13; access; symbols; locks; strict; comment @# @; 1.13 date 99.04.28.11.10.45; author alexis; state Exp; branches; next 1.12; 1.12 date 99.02.20.18.10.38; author alexis; state Exp; branches; next 1.11; 1.11 date 99.01.07.13.19.09; author alexis; state Exp; branches; next 1.10; 1.10 date 98.08.28.17.41.13; author alexis; state Exp; branches; next 1.9; 1.9 date 98.08.28.13.42.30; author alexis; state Exp; branches; next ; desc @SHPP PORT OF qtest.in 1.8 @ 1.13 log @included ../../bin/ppplc_msgids.shpp changed explicit message code numbers to shpp variables @ text @#!MARKER_SHELL_CMD PATH=/bin:/usr/bin PROGNAME=`basename $0` ############################################################################### # # # LINK QUALITY TESTER # # # ############################################################################### ############################################################################### # # CONFIGURABLE STUFF STARTS HERE # ############################################################################### COUNT=5 ############################################################################### # # CONFIGURABLE STUFF ENDS HERE # ############################################################################### VERSION="MARKER_PATCHLEVEL" # $Header: /diskb/home/alexis/dev/supported/ppplc/lib/misc/RCS/qtest.shpp,v 1.12 1999/02/20 18:10:38 alexis Exp alexis $ #shpp include ../../bin/ppplc_msgids.shpp SNDMSG=MARKER_LCLBINDIR/sndmsg ############################################################################### # # MAIN FUNCTION (called from very bottom of script) # ############################################################################### main() { ########################################################################### # # PROCESS OPTIONS # ########################################################################### 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 ;; -c) [ "X$2" = X ] && usage COUNT=$2 shift ;; -*) usage ;; *) break ;; esac shift done # One argument required - the host to use for the check [ "X$1" = X -o "X$2" != X ] && usage # Are locks required? No. This script should run very quickly. ########################################################################### # # CHECK QUALITY # ########################################################################### info "running, host=$1, count=$COUNT" QUALITY=`ping -c $COUNT -i 1 -n -q $1 2>/dev/null | sed -n -e 's/^.*ed, \([0-9].*\)% pack.*$/\1/p' | xargs expr 100 -` info "quality is ${QUALITY}%" $SNDMSG MARKER_MSGID_QTEST_RESPONSE $QUALITY } usage() { { echo "Usage: $PROGNAME [ -d | -v ] [ -c ] " echo " $PROGNAME -V" } >&2 exit 1 } #shpp include utils.sh.shpp #shpp include gep.sh.shpp @ 1.12 log @removed lockfile generator (not used). @ text @a12 9 # 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! # ############################################################################### ############################################################################### # d26 2 a27 1 # $Header: /diskb/home/alexis/dev/supported/ppplc/lib/misc/RCS/qtest.shpp,v 1.11 1999/01/07 13:19:09 alexis Exp alexis $ d76 1 a76 1 $SNDMSG 40 $QUALITY d89 1 @ 1.11 log @symbol name changes @ text @d35 1 a35 1 # $Header: qtest.shpp,v 1.10 1998/08/28 17:41:13 alexis Exp alexis $ a84 5 } gen_lock_file_name() { echo MARKER_LOCK_DIR/$PROGNAME.pid @ 1.10 log @removed version number tests @ text @d1 1 a1 1 #!SCRIPTSHELLCMD_MARKER d34 3 a36 3 VERSION="PATCHLEVEL_MARKER" # $Id: qtest.shpp,v 1.9 1998/08/28 13:42:30 alexis Exp alexis $ SNDMSG=LCLSBINDIR_MARKER/sndmsg d89 1 a89 1 echo LOCK_DIR_MARKER/$PROGNAME.pid d101 1 a101 2 #shpp include utils.sh @ 1.9 log @*** empty log message *** @ text @d35 1 a35 1 # $Id: qtest.in,v 1.8 1998/08/07 11:36:41 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 ;; d89 1 a89 1 echo LOCKDIR_MARKER/$PROGNAME.pid @