arm上實現(xiàn)PPP撥號腳本
作者:佚名
下面我們針對arm上實現(xiàn)PPP撥號腳本的內(nèi)容,進(jìn)行一下具體的介紹。針對它具體實現(xiàn)的代碼進(jìn)行了分析,希望對大家能夠有所幫助。
在之前的《Linux內(nèi)核PPP套件設(shè)置》一文中,我們已經(jīng)講解了相關(guān)的一些PPP套件設(shè)置操作。那么這里,我們依據(jù)前文的一些內(nèi)容,再來詳細(xì)講解一下arm上成功實現(xiàn)ppp撥號腳本的過程。
arm上成功實現(xiàn)ppp撥號腳本
ppp-on:
- #!/bin/sh
- pppd modem -d -detach lock /dev/ttySAC0 19200 kdebug 4 file /etc/ppp/options crtscts noipdefault netmask 255.255.255.0 defaultroute connect /etc/ppp/chat-script
ppp-off:
- #!/bin/sh
- ######################################################################
- #
- # Determine the device to be terminated.
- #
- if [ "$1" = "" ]; then
- DEVICE=ppp0
- else
- DEVICE=$1
- fi
- ######################################################################
- #
- # If the ppp0 pid file is present then the program is running. Stop it.
- if [ -r /var/run/$DEVICE.pid ]; then
- kill -INT `cat /var/run/$DEVICE.pid`
- #
- # If the kill did not work then there is no process running for this
- # pid. It may also mean that the lock file will be left. You may wish
- # to delete the lock file at the same time.
- if [ ! "$?" = "0" ]; then
- rm -f /var/run/$DEVICE.pid
- echo "ERROR: Removed stale pid file"
- exit 1
- fi
- #
- # Success. Let pppd clean up its own junk.
- echo "PPP link to $DEVICE terminated."
- exit 0
- fi
- #
- # The ppp process is not running for ppp0
- echo "ERROR: PPP link is not active on $DEVICE"
- exit 1
chat-script:
- #!/bin/sh
- exec chat -v \
- TIMEOUT 5 \
- ABORT "BUSY" \
- ABORT "ERROR" \
- ABORT "NO CARRIER" \
- '' \rAT \
- OK 'AT+CGDCONT=1,"IP","CMNET"' \
- OK 'ATDT*99***1#' \
- CONNECT '' \
設(shè)置DNS的resove.conf:
- nameserver 211.136.20.203
- nameserver 211.136.17.107
到此,arm ppp撥號腳本就設(shè)置好了。那么希望本文的代碼展示,能夠讓大家對此有所了解。
責(zé)任編輯:佟健
來源:
hi.baidu.com