blob: c111c00fcaef3a77e30908cbea3d31c213374fbd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#!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
|