下面我们针对arm上实现PPP拨号脚本的内容,进行一下具体的介绍。针对它具体实现的代码进行了分析,希望对大家能够有所帮助。
在之前的《Linux内核PPP套件设置》一文中,我们已经讲解了相关的一些PPP套件设置操作。那么这里,我们依据前文的一些内容,再来详细讲解一下arm上成功实现PPP拨号脚本的过程。
arm上成功实现ppp拨号脚本
ppp-on:
- #!/bin/sh
- pppdmodem-d-detachlock/dev/ttySAC019200kdebug4file/etc/ppp/optionscrtsctsnoipdefaultnetmask255.255.255.0defaultrouteconnect/etc/ppp/chat-script
ppp-off:
- #!/bin/sh
- ######################################################################
- #
- #Determinethedevicetobeterminated.
- #
- if["$1"=""];then
- DEVICE=ppp0
- else
- DEVICE=$1
- fi
- ######################################################################
- #
- #Iftheppp0pidfileispresentthentheprogramisrunning.Stopit.
- if[-r/var/run/$DEVICE.pid];then
- kill-INT`cat/var/run/$DEVICE.pid`
- #
- #Ifthekilldidnotworkthenthereisnoprocessrunningforthis
- #pid.Itmayalsomeanthatthelockfilewillbeleft.Youmaywish
- #todeletethelockfileatthesametime.
- if[!"$?"="0"];then
- rm-f/var/run/$DEVICE.pid
- echo"ERROR:Removedstalepidfile"
- exit1
- fi
- #
- #Success.Letpppdcleanupitsownjunk.
- echo"PPPlinkto$DEVICEterminated."
- exit0
- fi
- #
- #Thepppprocessisnotrunningforppp0
- echo"ERROR:PPPlinkisnotactiveon$DEVICE"
- exit1
chat-script:
- #!/bin/sh
- execchat-v\
- TIMEOUT5\
- ABORT"BUSY"\
- ABORT"ERROR"\
- ABORT"NOCARRIER"\
- ''\rAT\
- OK'AT+CGDCONT=1,"IP","CMNET"'\
- OK'ATDT*99***1#'\
- CONNECT''\
设置DNS的resove.conf:
- nameserver211.136.20.203
- nameserver211.136.17.107
到此,arm ppp拨号脚本就设置好了。那么希望本文的代码展示,能够让大家对此有所了解。
转载请说明出处
知优网 » arm上实现PPP拨号脚本(armbian pppoe拨号)
知优网 » arm上实现PPP拨号脚本(armbian pppoe拨号)