head 1.7; access; symbols; locks; strict; comment @# @; 1.7 date 99.04.28.09.44.31; author alexis; state Exp; branches; next 1.6; 1.6 date 99.04.26.16.13.46; author alexis; state Exp; branches; next 1.5; 1.5 date 99.02.20.17.59.49; author alexis; state Exp; branches; next 1.4; 1.4 date 99.01.07.13.04.21; author alexis; state Exp; branches; next 1.3; 1.3 date 98.08.31.12.39.39; author alexis; state Exp; branches; next 1.2; 1.2 date 98.08.28.17.39.26; author alexis; state Exp; branches; next 1.1; 1.1 date 98.08.28.13.08.24; author alexis; state Exp; branches; next ; desc @DONT HANG UP YET - SCRIPT TO KEEP THE CONNECT OPEN 20 MINUTES MAX @ 1.7 log @*** empty log message *** @ text @#!MARKER_SHELL_CMD ############################################################################### # # # DON'T HANG UP YET! # # ############################################################################### ############################################################################### # # 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! # ############################################################################### ############################################################################### # # USER CONFIGURABLE STUFF STARTS HERE # ############################################################################### ############################################################################### # # USER CONFIGURABLE STUFF ENDS HERE # ############################################################################### ############################################################################### # # PACKAGE INDEPENDENT VARIABLE SETTINGS # ############################################################################### PATH=/bin:/usr/bin PROGNAME=`basename $0` VERSION="MARKER_PATCHLEVEL" #UMASK=022 #LOCK_DIR=MARKER_LOCK_DIR #ERRORS_CAUSE_EXITS=true # $Header: /diskb/home/alexis/dev/supported/ppplc/bin/RCS/dhuy.shpp,v 1.6 1999/04/26 16:13:46 alexis Exp alexis $ #shpp include sm_msgids.shpp #shpp include ppplc_msgids.shpp ############################################################################### # # PACKAGE SPECIFIC VARIABLE SETTINGS # ############################################################################### SNDMSG=MARKER_LCLBINDIR/sndmsg ############################################################################### # # MAIN FUNCTION (called from very bottom of script) # ############################################################################### main() { ########################################################################### # # PROCESS OPTIONS # ########################################################################### # default values for things changable by command line options MODE=dhuy 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) MODE=cancel ;; -*) usage ;; *) break ;; esac shift done # Are locks required? Nah. # Are you going to register temporary files? No. #trap sighandler 1 2 15 ########################################################################## # # SCRIPT GUTS STARTS HERE # ########################################################################## # clear pending announcements $SNDMSG MARKER_MSGID_DEL_MSGID MARKER_MSGID_EXEC_ANNOUNCE # clear pending hangups $SNDMSG MARKER_MSGID_DEL_MSGID MARKER_MSGID_HANGUP # announce 'pending hangups cancelled' now $SNDMSG MARKER_MSGID_EXEC_ANNOUNCE 9 if [ $MODE = dhuy ]; then # announce 'going down in 5 minutes' in 15 minutes $SNDMSG -q 900 MARKER_MSGID_EXEC_ANNOUNCE 7 # queue a hangup for 20 minutes $SNDMSG -q 1200 MARKER_MSGID_HANGUP # announce 'going down in 20 minutes' now $SNDMSG MARKER_MSGID_EXEC_ANNOUNCE 8 fi } usage() { { echo "Usage: $PROGNAME [ -d | -v ] [ -c ]" echo " $PROGNAME -V" } >&2 exit 2 } #shpp include utils.sh.shpp #shpp include gep.sh.shpp @ 1.6 log @added gen.sh.shpp include @ text @d42 3 a44 1 # $Header: /diskb/home/alexis/dev/supported/ppplc/bin/RCS/dhuy.shpp,v 1.5 1999/02/20 17:59:49 alexis Exp alexis $ d98 7 d106 2 a107 6 # clear pending announcements $SNDMSG 48 26 # clear pending hangups $SNDMSG 48 5 # queue a 'going down in 5 minutes' announcement for fifteen minutes $SNDMSG -q 900 26 7 d109 3 a111 6 $SNDMSG -q 1200 5 # queue a 'hangups cancelled, rescheduled for 20 mins' announcement $SNDMSG 26 8 else $SNDMSG 48 26 $SNDMSG 48 5 a112 1 #exitdel @ 1.5 log @lockfile name generator removed (not used). @ text @d42 1 a42 1 # $Header: /diskb/home/alexis/dev/supported/ppplc/bin/RCS/dhuy.shpp,v 1.4 1999/01/07 13:04:21 alexis Exp alexis $ d125 1 @ 1.4 log @symbol name changes @ text @d42 1 a42 1 # $Header: dhuy.shpp,v 1.3 1998/08/31 12:39:39 alexis Exp alexis $ a85 1 #lock || error "locking failed" a111 17 #unlock } gen_lock_file_name() { L_LOCK_WHAT=$1 # little hack is so this shell library can but doesn't have to be compiled { expr "$LOCK_DIR" : 'LOCK_DIR_MA.KER$' > /dev/null; } && LOCK_DIR= L_LOCK_DIR=${LOCK_DIR:-/var/run} # For instance if you're just preventing concurrent executions of this # program then this should be sufficient: #echo $L_LOCK_DIR/$PROGNAME.pid # On th other hand, database programs *without* a centralised db spooldir, # will want lock files in the same directory as the table file, like this: #echo .$L_LOCK_WHAT.lock @ 1.3 log @now delete messages off queue, rather than substitute them for noaction @ text @d1 1 a1 1 #!SCRIPTSHELLCMD_MARKER d38 1 a38 1 VERSION="PATCHLEVEL_MARKER" d40 1 a40 1 #LOCK_DIR=LOCK_DIR_MARKER d42 1 a42 1 # $Id: dhuy.shpp,v 1.2 1998/08/28 17:39:26 alexis Exp alexis $ d50 1 a50 1 SNDMSG=LCLBINDIR_MARKER/sndmsg d86 1 a86 1 #lock d142 1 a142 1 #shpp include utils.sh @ 1.2 log @removed the test on version names, because it fails when stderr is redirected. @ text @d42 1 a42 1 # $Id: dhuy.shpp,v 1.1 1998/08/28 13:08:24 alexis Exp alexis $ d99 1 a99 1 $SNDMSG 31 26 24 d101 1 a101 1 $SNDMSG 31 5 24 d109 2 a110 2 $SNDMSG 31 26 24 $SNDMSG 31 5 24 @ 1.1 log @Initial revision @ text @d42 1 a42 1 # $Id: mondsk.shpp,v 1.13 1998/08/23 14:38:06 alexis Exp $ d68 1 a68 1 PAUSE=0 d72 2 a73 7 -V) if expr "$VERSION" : 'PATCHLEVEL_MA.KER$' > /dev/null; then warning "this is a development version; use 'ident' for version information" exit 1 else echo "$PROGNAME version $VERSION" exit 0 fi ;; d78 1 d97 15 a111 11 # clear pending announcements $SNDMSG 31 26 24 # clear pending hangups $SNDMSG 31 5 24 # queue a 'going down in 5 minutes' announcement for fifteen minutes $SNDMSG -q 900 26 7 # queue a hangup for 20 minutes $SNDMSG -q 1200 5 # queue a 'pending hangups cancelled, rescheduled for 20 mins' announcement $SNDMSG 26 8 d135 1 a135 1 echo "Usage: $PROGNAME [ -d | -v ]" @