On 07-May-2001 [EMAIL PROTECTED] wrote:
> When dialling one of those ISPs that start ppp automatically,
> what do you put in /etc/diald/connect - "noauth" or what?
The following connect script did the trick for me. It just initialises the
modem, dials the number and makes sure the call is answered by a modem.
You then need to put your login info in /etc/ppp/(ch|p)ap-secrets as someone
else has already described.
#!/bin/sh
#
# This script is hacked from an example provided with the most excellent
# diald.
#
# Copyright (c) 1996, Eric Schenk.
#
# This script is intended to give an example of a connection script that
# uses the "message" facility of diald to communicate progress through
# the dialing process to a diald monitoring program such as dctrl or diald-top.
# It also reports progress to the system logs. This can be useful if you
# are seeing failed attempts to connect and you want to know when and why
# they are failing.
#
# This script requires the use of chat-1.9 or greater for full
# functionality. It should work with older versions of chat,
# but it will not be able to report the reason for a connection failure.
# Configuration parameters
# The initialization string for your modem
# MODEM_INIT="ATZL0&C1&D2%C0"
MODEM_INIT="ATZ"
MODEM_INIT2="ATM0L0&C1&D2%C0W1"
# The phone number to dial
PHONE_NUMBER="08005190100"
#PHONE_NUMBER="08005190150"
# The chat sequence to recognize that the remote system
# is asking for your user name.
#USER_CHAT_SEQ=""
# The string to send in response to the request for your user name.
#USER_NAME=""
# The chat sequence to recongnize that the remote system
# is asking for your password.
#PASSWD_CHAT_SEQ=""
# The string to send in response to the request for your password.
#PASSWORD=""
# The prompt the remote system gives to indicate it will dial back.
#DIALBACK=""
# The prompt the remote system will give once you are logged in
# If you do not define this then the script will assume that
# there is no command to be issued to start up the remote protocol.
#PROMPT="ocol:"
# The command to issue to start up the remote protocol. If this
# is defined, issue it even if PROMPT is not defined.
#PROTOCOL_START="slip"
# The string to wait for to see that the protocol on the remote
# end started OK. If this is empty then no check will be performed.
#START_ACK="Switching to PPP."
#START_ACK="HELLO"
# The chat command. chat -v logs the chatting to the syslog.
CHAT="/usr/sbin/chat -v"
# CHAT="chat"
# Pass a message on to diald and the system logs.
function message () {
[ $FIFO ] && echo "message $*" >$FIFO
logger -p local2.info -t connect "$*"
}
# Initialize the modem. Usually this just resets it.
message "Initializing Modem"
$CHAT TIMEOUT 5 "" $MODEM_INIT TIMEOUT 45 OK "\c"
if [ $? != 0 ]; then
message "Failed to initialize modem"
exit 1
fi
$CHAT TIMEOUT 5 "" $MODEM_INIT2 TIMEOUT 45 OK "\c"
if [ $? != 0 ]; then
message "Failed to initialize modem(2)"
exit 1
fi
# Dial the remote system.
message "Dialing system"
$CHAT \
TIMEOUT 90 \
ABORT "NO CARRIER" \
ABORT BUSY \
ABORT "NO DIALTONE" \
ABORT ERROR \
"" ATDT$PHONE_NUMBER \
CONNECT "\c"
case $? in
0) message Connected;;
1) message "Chat Error"; exit 1;;
2) message "Chat Script Error"; exit 1;;
3) message "Chat Timeout"; exit 1;;
4) message "No Carrier"; exit 1;;
5) message "Busy"; exit 1;;
6) message "No DialTone"; exit 1;;
7) message "Modem Error"; exit 1;;
*)
esac
# Success!
message "Protocol starting"
--
Jim Hague - [EMAIL PROTECTED] (Work), [EMAIL PROTECTED] (Play)
Never trust a computer you can't lift.
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug