LinuxÒÁµéÔ°ÂÛ̳'s Archiver

chuty ·¢±íÓÚ 2008-4-7 18:13

ÈçºÎʵÏÖºÓÄÏ¿í´ølinuxϵÄ×Ô¶¯µÇ½½Å±¾

ºÓÄÏ¿í´ø»¹Óкܶà²ÉÓõÄÊÇDHCP+µÄµÇ½·½Ê½£¬ÓÃÍøÍ¨ÌṩµÄµÇ½³ÌÐòÊÖ¹¤µÇ½ûÓÐÎÊÌ⣬
µ«ÊÇÏÖÔÚÏëдһ¸ö½Å±¾×Ô¶¯µÇ½£¬Ò»¸öÅóÓѸøµÄ½Å±¾ÈçÏÂ
#!/bin/bash
cd /racer
./ecou.sh start <<!
eth0
user
pwd
!
sleep 420
/racer/ecou.sh stop

µ«ÊÇ»áÍ£ÔÚÊäÈëÃÜÂëµÄλÖ㬵ȴýÊÖ¹¤ÊäÈëÃÜÂë¡£Èç¹ûҪʵÏÖºÃÏñÒªÓõ½expect£¬µ«ÊÇÎÒȷʵ²»¶®
Õâ¸ö£¬Ï£ÍûÄܵõ½ÅóÓÑÃǵİïæ£¬Ð»Ð»

dearvoid ·¢±íÓÚ 2008-4-8 12:27

Äã°ÑÊÖ¹¤µÇ¼µÄ¹ý³ÌÏêϸÃèÊöÒ»ÏÂ, ´ó¼Ò°ïÄãдһ¸ö¿´¿´

chuty ·¢±íÓÚ 2008-4-8 13:45

Ò»ÏÂÊǵǽÿһ²½µÄͼƬ

[root@ts home]#./ecou.sh start
All names of your net interface installed
------------------------------------------
          eth0     0
Input one name to hace access with Internet (eth0): eth0

The name of interface is: eth0
The process is checking your IP address, please hold on ...

Please Enter your LOGIN:ZZ000016398
Input a password: and your PASSWORD:

Your passwd is correct. please wait for renewing IP address ...
racere has been started successfully

dearvoid ·¢±íÓÚ 2008-4-8 14:41

¸ø¸öʾÀý, ÕÕןĸÄÊÔÊÔ:
[code]
#!/usr/bin/expect -f

# starting ...
spawn ./ecou.sh start
expect "Input one name to hace access with Internet (eth0):"
send "eth0\r"
expect "Please Enter your LOGIN:"
# username
send "ZZ000016398\r"
expect "and your PASSWORD:"
# password
send "XXXX\n"
expect "has been started successfully"
expect eof
[/code]

li-jiahuan ·¢±íÓÚ 2008-4-8 22:47

ÒÔǰÓûªÎªµÄ¿Í»§¶Ëʱ£¬ :victory: ÓвÎÊýʹÓÃÃ÷ÎÄÃÜÂëµÄ·½Ê½:victory:

Ò³: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.