标题: ppp-on-dialer中的变量
edisontang
新生入学
Rank: 1
注册用户



UID 101296
精华 0
积分 5(积分有什么用?)
帖子 31
阅读权限 10
注册 2004-11-16
状态 离线
发表于 2008-5-7 13:35  资料  个人空间  短消息  加为好友 

Linux爱好者的盛会
ppp-on-dialer中的变量

ppp-on:
#!/bin/sh
#
# Script to initiate a ppp connection. This is the first part of the
# pair of scripts. This is not a secure pair of scripts as the codes
# are visible with the 'ps' command. However, it is simple.
#
# These are the parameters. Change as needed.
TELEPHONE="*99***1#"
ACCOUNT=
PASSWORD=
APN=CMNET
LOCAL_IP=0.0.0.0
REMOTE_IP=0.0.0.0
NETMASK=255.255.255.0
export TELEPHONE ACCOUNT PASSWORD APN
#
# This is the location of the script which dials the phone and logs
# in. Please use the absolute file name as the $PATH variable is not
# used on the connect option. (To do so on a 'root' account would be
# a security hole so don't ask.)
#
#DIALER_SCRIPT=/etc/ppp/ppp-dialer
DIALER_SCRIPT=/etc/ppp-on-dialer
#
# Initiate the connection
#
# I put most of the common options on this command. Please, don't
# forget the 'lock' option or some programs such as mgetty will not
# work. The asyncmap and escape will permit the PPP link to work with
# a telnet or rlogin connection. You are welcome to make any changes
# as desired. Don't use the 'defaultroute' option if you currently
# have a default route to an ethernet gateway.
#
echo $DIALER_SCRIPT
exec /sbin/pppd usehostname -detach   noipdefault debug lock modem crtscts 115200 \
/dev/ttyS1 usepeerdns novj asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IPREMOTE_IP \
netmask $NETMASK nodefaultroute connect $DIALER_SCRIPT


ppp-on-dialer:
#!/bin/sh
#
# This is part 2 of the ppp-on script. It will perform the connection
# protocol for the desired connection.
#
exec chat -v \
TIMEOUT 3 \
ABORT '\nBUSY\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' AT \
OK ATH \
OK ATE1 \
OK AT+CGATT=1 \
OK 'AT+CGDCONT=1,"IP","$APN"' \
OK ATD$TELEPHONE \
TIMEOUT 30
CONNECT ''

在ppp-on-dialer中使用OK 'AT+CGDCONT=1,"IP","$APN"'就没办法拨上CMNET,如果用OK 'AT+CGDCONT=1,"IP","CMNET"'就可以了,这是为什么呢,怎么解决呢?

在这个文件中ATD$TELEPHONE ,这里也是使用了变量的啊?

顶部
stillriver
新生入学
Rank: 1



UID 225735
精华 0
积分 18(积分有什么用?)
帖子 8
阅读权限 10
注册 2008-4-21
状态 离线
发表于 2008-5-7 15:04  资料  个人空间  短消息  加为好友 
那个笑脸是什么符号啊?





welcome2web.cn
顶部
 



当前时区 GMT+8, 现在时间是 2008-5-13 11:27

    Powered by Discuz! 5.5.0  © 2001-2007 Comsenz Inc.
Processed in 0.103703 second(s), 5 queries

清除 Cookies - 联系我们 - Linux伊甸园 - Archiver - WAP