#!/bin/sh
######################################################################
#
# This script is part of the PPP System designed and used by
# Preston A. Elder of Shadow Realm.  If you have any problems
# with this system please email prez@antisocial.com.
#
# This system is publically distributable via. the GNU license.
#
######################################################################
#
# ISP Specific dialer script
#
. /etc/ppp-settings

echo "`date` - $ISP PPP" >>${baseLOG}/redial.log

# This script will:
#	1) Abort if the modem returns BUSY, NO ANSWER or RING in 5 seconds.
#	2) Hang up modem
#	3) Dial ISP, but ABORT if the following isnt completed in 45 seconds.
#	4) For CHAP/PAP that should be it, otherwise:
#		1) Wait for "sername:" prompt and put your ACCOUNT
#		2) Wait for "assword:" prompt and put your PASSWORD
#		3) Put ppp (does not wait for anything).
#
# The telephone no. account name and password are derived from the associated
# -data file.

exec chat $CHATOPT						\
	TIMEOUT			5				\
	ABORT			'\nBUSY\r'			\
	ABORT			'\nNO ANSWER\r'			\
	ABORT			'\nRING\r\n\r\nRING\r'		\
	''			\rAT				\
	'OK-+++\c-OK'		ATH0				\
	TIMEOUT			45				\
	OK			ATDT$TELEPHONE			\
	CONNECT			''				\
	sername:--sername:	$ACCOUNT			\
	assword:		$PASSWORD			\
	''			ppp

# IMPORTANT:
#
# For CHAP/PAP users, you will need to remove all lines after:
#	CONNECT			''				\
# You will also need to remove the \ on the last line in the
# sequence (else it breaks!).  For all other users, you will need
# to modify everything below the same line to suit your ISP's
# dialin routnie. 

# END SCRIPT
