58 lines
1.3 KiB
Plaintext
58 lines
1.3 KiB
Plaintext
|
#!xchat
|
||
|
# @(#) Hangup.Hayes V1.1 Tue Sep 1 14:04:25 1992 (Bob Denny)
|
||
|
#
|
||
|
# xchat script for hanging up a Hayes-type modem. When used with Taylor
|
||
|
# UUCP, this script should be run as the dialer-complete and dialer-abort
|
||
|
# script with xchat.
|
||
|
#
|
||
|
# Usage:
|
||
|
# xchat Hangup.Hayes [ x ]
|
||
|
#
|
||
|
# where 'x' is any string. If it is present, this script will log the
|
||
|
# modem reset as an ABORT reset, otherwise it will not log anything.
|
||
|
#
|
||
|
# Uncomment the lines starting with '###' to get debugging log.
|
||
|
#
|
||
|
start:
|
||
|
### dbgfile Hangup.Log
|
||
|
### dbgset 15
|
||
|
zero
|
||
|
sleep 2000 # Wait for trailing garbage
|
||
|
flush # Toss it out
|
||
|
ifnstr wakemodem 0 # No abort indicator
|
||
|
log Hangup on abort
|
||
|
#
|
||
|
# Get modem's attention via Hayes 'escape' protocol.
|
||
|
#
|
||
|
wakemodem:
|
||
|
sleep 4000
|
||
|
send +++
|
||
|
sleep 4000
|
||
|
send \r
|
||
|
timeout reset 2000
|
||
|
expect reset OK
|
||
|
#
|
||
|
# We're (probably) in command mode. Use ATZ (reset) to hang up
|
||
|
# as some modems don't behave well with ATH0 command.
|
||
|
#
|
||
|
reset:
|
||
|
send ATZ\r
|
||
|
timeout silent 5000
|
||
|
expect done OK
|
||
|
#
|
||
|
# Finished, modem is back in initial state.
|
||
|
#
|
||
|
done:
|
||
|
success
|
||
|
#
|
||
|
# No response to escape protocol. Log the error and force DTR low
|
||
|
# in an attempt to get control of the modem. Then send ATZ just to
|
||
|
# make sure.
|
||
|
#
|
||
|
silent:
|
||
|
logerr Hangup: no response from modem
|
||
|
hangup # Force DTR low as last gasp
|
||
|
send ATZ\r
|
||
|
sleep 5000
|
||
|
failed
|