加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
quectel-pppd.sh 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
MrVW 提交于 2023-06-09 21:02 . init ppp
#!/bin/sh
#quectel-pppd devname apn user password
echo "quectel-pppd options in effect:"
QL_DEVNAME=/dev/ttyUSB3
QL_APN=3gnet
QL_USER=user
QL_PASSWORD=passwd
if [ $# -ge 1 ]; then
QL_DEVNAME=$1
echo "devname $QL_DEVNAME # (from command line)"
else
echo "devname $QL_DEVNAME # (default)"
fi
if [ $# -ge 2 ]; then
QL_APN=$2
echo "apn $QL_APN # (from command line)"
else
echo "apn $QL_APN # (default)"
fi
if [ $# -ge 3 ]; then
QL_USER=$3
echo "user $QL_USER # (from command line)"
else
echo "user $QL_USER # (default)"
fi
if [ $# -ge 4 ]; then
QL_PASSWORD=$4
echo "password $QL_PASSWORD # (from command line)"
else
echo "password $QL_PASSWORD # (default)"
fi
CONNECT="'chat -s -v ABORT BUSY ABORT \"NO CARRIER\" ABORT \"NO DIALTONE\" ABORT ERROR ABORT \"NO ANSWER\" TIMEOUT 30 \
\"\" AT OK ATE0 OK ATI\;+CSUB\;+CSQ\;+CPIN?\;+COPS?\;+CGREG?\;\&D2 \
OK AT+CGDCONT=1,\\\"IP\\\",\\\"$QL_APN\\\",,0,0 OK ATD*99# CONNECT'"
pppd $QL_DEVNAME 115200 user "$QL_USER" password "$QL_PASSWORD" \
connect "'$CONNECT'" \
disconnect 'chat -s -v ABORT ERROR ABORT "NO DIALTONE" SAY "\nSending break to the modem\n" "" +++ "" +++ "" +++ SAY "\nGood bay\n"' \
noauth debug defaultroute noipdefault novj novjccomp noccp ipcp-accept-local ipcp-accept-remote ipcp-max-configure 30 local lock modem dump nodetach nocrtscts usepeerdns &
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化