18.5. 用于 PAP/CHAP 认证连接的 chat 脚本

如果您的 ISP 使用 PAP/CHAP,那么您的 chat 脚本会简单得多。 您的 chat 脚本只需要拨打电话,等待连接,然后让 pppd 处理登录!

#!/bin/sh
#
# This is part 2 of the ppp-on script. It will perform the connection
# protocol for the desired connection.
#
exec /usr/sbin/chat -v                                  \
        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         ''                              \