時間:2015-06-28 00:00:00 來源:IT貓撲網(wǎng) 作者:網(wǎng)管聯(lián)盟 我要評論(0)
在之前的《Linux內(nèi)核PPP套件設置》一文中,我們已經(jīng)講解了相關的一些PPP套件設置操作。那么這里,我們依據(jù)前文的一些內(nèi)容,再來詳細講解一下arm上成功實現(xiàn)ppp撥號腳本的過程。
arm上成功實現(xiàn)ppp撥號腳本
ppp-on:
1.#!/bin/sh
2.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:
1.#!/bin/sh
2.######################################################################
3.#
4.# Determine the device to be terminated.
5.#
6.if [ "$1" = "" ]; then
7.DEVICE=ppp0
8.else
9.DEVICE=$1
10.fi
11.
12.######################################################################
13.#
14.# If the ppp0 pid file is present then the program is running. Stop it.
15.if [ -r /var/run/$DEVICE.pid ]; then
16.? kill -INT `cat /var/run/$DEVICE.pid`
17.#
18.# If the kill did not work then there is no process running for this
19.# pid. It may also mean that the lock file will be left. You may wish
20.# to delete the lock file at the same time.
21.? if [ ! "$?" = "0" ]; then
22.??? rm -f /var/run/$DEVICE.pid
23.??? echo "ERROR: Removed stale pid file"
24.??? exit 1
25.? fi
26.#
27.# Success. Let pppd clean up its own junk.
28.? echo "PPP link to $DEVICE terminated."
29.? exit 0
30.fi
31.#
32.# The ppp process is not running for ppp0
33.echo "ERROR: PPP link is not active on $DEVICE"
34.exit 1
chat-script:
1.#!/bin/sh
2.exec chat -v \
3.TIMEOUT 5 \
4.ABORT?? "BUSY" \
5.ABORT?? "ERROR" \
6.ABORT?? "NO CARRIER" \
7.'' \rAT?? \
8.OK 'AT+CGDCONT=1,"IP","CMNET"' \
9.OK 'ATDT*99***1#' \
10.CONNECT '' \
設置DNS的resove.conf:
1.nameserver 211.136.20.203
2.nameserver 211.136.17.107
到此,arm ppp撥號腳本就設置好了。那么希望本文的代碼展示,能夠讓大家對此有所了解。
關鍵詞標簽:腳本,撥號,PPP,實現(xiàn),a
相關閱讀
熱門文章 路由器地址大全-各品牌路由設置地址 各品牌的ADSL與路由器出廠默認IP、帳號、密碼 Nslookup命令詳解-域名DNS診斷 站長裝備:十大網(wǎng)站管理員服務器工具軟件
人氣排行 各品牌的ADSL與路由器出廠默認IP、帳號、密碼 路由器地址大全-各品牌路由設置地址 騰達路由器怎么設置?騰達路由器設置教程 ADSL雙線負載均衡設置詳細圖文教程 路由表說明(詳解route print) Nslookup命令詳解-域名DNS診斷 網(wǎng)管員實際工作的一天 網(wǎng)管必會!了解交換機控制端口流量