SDC Consultancy Services wrote:
>
> I am a new convert to diald and have just installed it.
> The routing table is okay, the slip device is configured ok.
> The only problem I have is that on attempting to go to any non local
> site, diald does not run the connect script.
> I cannot seem to figure out what I have got wrong.
> I am using a script I had used with pppd to connect.
>
> --
> SDC Consultancy Services Ltd
> P O Box 50760 Falomo
> Lagos State, NIGERIA
>
>
>
> ---------------------------------------------------------------
> mode ppp
> connect /root/microcom
> device /dev/modem
> speed
> modem
> lock
> crtscts
> local 192.168.0.1
> remote 192.168.0.2
> dynamic 192.168.0.2
> defaultroute
> include /usr/lib/diald/standard.filter
The ppp scripts typically try to control the modem connection and setup
the default route. Below is my diald connect script which has been
working well:
========================================================================
infordec@ps-server> cat /etc/diald/connect
#!/bin/sh
# 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="AT&FV1&C1E0Q0S71=0S80=1&D2"
MODEM_INIT="AT&FE0"
# The phone number to dial
PHONE_NUMBER="<your phone number>"
# The chat sequence to recognize that the remote system
# is asking for your user name.
USER_CHAT_SEQ="ogin:--ogin:--ogin:--ogin:--ogin:--ogin:--ogin:"
# The string to send in response to the request for your user name.
USER_NAME="<your user name>"
# The chat sequence to recongnize that the remote system
# is asking for your password.
PASSWD_CHAT_SEQ="word:"
# The string to send in response to the request for your password.
PASSWORD="<your password>"
# 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="Entering PPP"
PROMPT = ""
# The command to issue to start up the remote protocol
#PROTOCOL_START="ppp"
PROTOCOL_START=""
# 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=""
# 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"
/usr/sbin/chat -v \
TIMEOUT 5 \
ABORT '\nBUSY\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' 'AT' \
'OK-+++\c-OK' ATH0 \
OK $MODEM_INIT \
OK ''
if [ $? != 0 ]; then
message "Failed to initialize modem"
exit 1
fi
# Dial the remote system.
message "Dialing system"
message "Modem initialized OK"
sleep 5
/usr/sbin/chat -v \
TIMEOUT 45 \
"" ATDT$PHONE_NUMBER \
CONNECT ""
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
message "Modem is connected to host!"
sleep 5
# We're connected try to log in.
message "Loggin in"
/usr/sbin/chat -v \
TIMEOUT 15 \
$USER_CHAT_SEQ $USER_NAME \
TIMEOUT 45 \
$PASSWD_CHAT_SEQ $PASSWORD
if [ $? != 0 ]; then
message "Failed to log in"
exit 1
fi
message "Modem is logged in!"
# We logged in, try to start up the protocol (provided that the
# user has specified how to do this)
if [ $PROMPT ]; then
message "Starting Comm Protocol"
/usr/sbin/chat -v \
TIMEOUT 15 $PROMPT $PROTOCOL_START
if [ $? != 0 ]; then
message "Prompt not received"
exit 1
fi
fi
if [ $START_ACK ]; then
/usr/sbin/chat -v \
TIMEOUT 15 $START_ACK ""
if [ $? != 0 ]; then
message "Failed to start Protocol"
exit 1
fi
fi
# Success!
message "Protocol started"
#------ end of script -------
-
To unsubscribe from this list: send the line "unsubscribe linux-diald" in
the body of a message to [EMAIL PROTECTED]