|
|
第 1 帖 | |||
|
|
标题: 连网的脚本 #cat up
引用:
还有个断开连接的脚本: # cat down 引用:
是用ADSL上网,这是ifconfig eth0 Link encap:Ethernet HWaddr 00:**:**:**:**:** UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:507 errors:0 dropped:0 overruns:0 frame:0 TX packets:488 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:333786 (325.9 Kb) TX bytes:115596 (112.8 Kb) Interrupt:11 Base address:0xe000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:86 errors:0 dropped:0 overruns:0 frame:0 TX packets:86 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:5068 (4.9 Kb) TX bytes:5068 (4.9 Kb) ppp0 Link encap:Point-to-Point Protocol inet addr:220.*.*.* P-t-P:172.0.0.1 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1 RX packets:458 errors:0 dropped:0 overruns:0 frame:0 TX packets:439 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:320699 (313.1 Kb) TX bytes:102938 (100.5 Kb) 此帖于 03-12-27 01:55 被 home 编辑. |
|||
|
|
|
|||
|
|
第 2 帖 | |
|
|
估计又是引号的错!手动没问题吧~
|
|
|
|
|
|
|
|
第 3 帖 | |
|
|
直接输入adsl-start没问题。这是下网再连上的情况。
# up d8 a9 The old MAC : 00:E0:**:**:**:A0 /root/bin/up: line 13: 00:**:**:**:d8:a9: command not found The new MAC : /root/bin/up: line 15: *.*.*.*: command not found now IP is 这时已连上了,就是新的MAC和IP没有显示。 |
|
|
|
|
|
|
|
第 4 帖 | |
|
|
NEWMAC= `ifconfig eth0|grep eth0|awk '{print $5}'`
注意等号后面的空格! adsl-start ;sync; sleep 3; NEWIP= `ifconfig ppp0|grep addr|awk '{print $2}'|cut -f2 -d ":"` 这行也是! 都去掉! |
|
|
|
|
|
|
|
第 5 帖 | |
|
|
以后要注意格式了。不知道解释得好吗?要是不满意,请帮我改改!!!! ![]() 此帖于 03-12-26 22:17 被 home 编辑. |
|
|
|
|
|
|
|
第 6 帖 | ||
|
|
引用:
![]() |
||
|
|
|
||
|
|
第 7 帖 | |
|
|
37531679 请加入 linux 讨论群
|
|
|
|
|
|