Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 331177f1cf202be42c638edbb206ddef > files > 22

gpppwrap-1.0-3mdk.i586.rpm

#!/bin/sh
#
# This is ppp-on-dialer-login.
# The script will perform the connection protocol for the desired connection.
# 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 login screen authentication.
# It expects a login prompt and sends the password.
# The telephone number, login and password
# may be given as argument to the script or via environment variables.
if [ -n "$3" ]; then
        TELEPHONE="$1"
        ACCOUNT="$2"
        PASSWORD="$3"
        export TELEPHONE
        export ACCOUNT
        export PASSWORD
fi
if [ -z "$PASSWORD" ];then
	echo "ERROR: dialer, PASSWORD not set" 1>&2
	exit 1
fi
if [ -z "$ACCOUNT" ];then
	echo "ERROR: dialer, ACCOUNT not set" 1>&2
	exit 1
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		''				\
	ogin:--ogin:	$ACCOUNT			\
	assword:	$PASSWORD