System Administration Guide: Resource Management and Network Services

How to Invoke a Chat Script (Task)

  1. Create the chat script as an ASCII file.

  2. Invoke the chat script in any PPP configuration file by using the following syntax:


    connect 'chat  -f /etc/ppp/chatfile'

    The -f flag indicates that a file name is to follow. /etc/ppp/chatfile represents the name of the chat file.

  3. Give read permission for the external chat file to the user who will run the pppd command.


    Caution – Caution –

    The chat program always runs with the user's privileges, even if the connect 'chat ...' option is invoked from a privileged source. Thus, a separate chat file that is read with the -f option must be readable by the invoking user. This privilege can be a security problem if the chat script contains passwords or other sensitive information.


Chat Script in an External File

If the chat script that is needed for a particular peer is long or complicated, consider creating the script as a separate file. External chat files are easy to maintain and document. You can add comments to the chat file by preceding them with the hash (#) sign.

The procedure How to Create the Instructions for Calling a Peer shows the use of a chat script that is contained in an external file.

Inline Chat Script

You can place the entire chat script conversation on a single line, similar to the following:


connect 'chat "" "AT&F1" OK ATDT5551212 CONNECT "\c"'
The phrase that follows the chat keyword and terminates with “\c”` is the complete chat script. You use this form in any PPP configuration file or on the command line, as an argument to pppd.