#!/bin/sh # # This is ppp-on-dialer-pap. # The script will talk to your modem via AT commands. # To manually log in use "cu -l /dev/modem dir" and terminate with # "~." To use minicom. Run minicom -s, go to "Serial port setup" and set the # serial device, go to "Modem and dialing" and set the initstring to nothing. # If you use minicom then terminate with crtl-a q # Note: only minicom can terminate without re-setting (crtl-a q). Only # with minicom you can then run manually "pppd -d /dev/modem 38400". # # Note: you can not use this script stand alone it needs to be called # from pppd. # # The script below is specifically for pap authentication. It does # not expect a login prompt. # # The telephone number may be given as argument to the script or # via environment variables. if [ -n "$1" ]; then TELEPHONE="$1" export TELEPHONE fi if [ -z "$TELEPHONE" ]; then echo "ERROR: dialer, TELEPHONE not set" 1>&2 exit 1 fi # # to debug the conversation with your modem use: exec chat -v \ exec chat \ TIMEOUT 3 \ ABORT '\nBUSY\r' \ ABORT '\nNO ANSWER\r' \ ABORT '\nRINGING\r\n\r\nRINGING\r' \ '' \rAT \ 'OK-+++\c-OK' ATH0 \ TIMEOUT 30 \ OK ATDT$TELEPHONE \ CONNECT ''