Listing 2: Sample dial script, called from dialer
#!/bin/ksh
## my standard output is the modem. My std input is the modem.
## this program should be called only after "dialer"
## has taken care of above.
echo "ATDT555-5555\r"
sleep 20
echo "loginname\r"
## you can do "read" for modem responses
## or simply use waitfor, a standalone binary which comes with pcomm
waitfor assword
echo "password\r"
## wait for login messages, then send file:
sleep 2
echo "rx FOO\r"
sx FOO
## show status message to stderr, which is the user's terminal,
## NOT the modem.
echo "status of sx is $?" 1>&2
sleep 2
rx -c BAR
## sleep to let remote cogitate and do the hanging-up
## (if you don't, sometimes Bad Things will happen)
sleep 5
exit
# implicit hangup of port.
## End of File
|