代码: 全选
xxx@xxx-desktop:~$ sudo su
[sudo] password for xxx:
root@xxx-desktop:/home/xxx# ifconfig eth0 222.17.xxx.xxx
root@xxx-desktop:/home/xxx# xrgsu -d
XRGSupplicant 1.1.1
Ruijie Network CopyRight 2004-2005
Please input your user name:xxxxx
Please input your password:
Use default auth parameter,0-Use 1-UnUse(Default: 0):
Searching server...
Connecting server...
Authenticating...
07������ϵ�г�Ӫ�����
��֤�ɹ���
Authenticate SUCCESSFULLY!
eth0: 没有进程被杀死
There is already a pid file /var/run/dhclient.pid with pid 4057
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Listening on LPF/eth0/00:e0:61:02:b8:8c
Sending on LPF/eth0/00:e0:61:02:b8:8c
Sending on Socket/fallback
DHCPREQUEST of 222.17.xxx.xxx on eth0 to 255.255.255.255 port 67
DHCPREQUEST of 222.17.xxx.xxx on eth0 to 255.255.255.255 port 67
DHCPACK of 222.17.xxx.xxx from 202.192.224.166
bound to 222.17.xxx.xxx-- renewal in 70231 seconds.
Searching server...
Connecting server...
Authenticating...
07������ϵ�г�Ӫ�����
��֤�ɹ���
Authenticate SUCCESSFULLY!
Please input 'unauth' to LogOff:unauth
If system work in DHCP mode,please resume IP address!
xrgsu exit!
root@xxx-desktop:/home/xxx# xrgsu -a
XRGSupplicant 1.1.1
Ruijie Network CopyRight 2004-2005
Please input your user name:xxxx
Please input your password:
Use DHCP,1-Use,0-UnUse(Default: 0):1
Use default auth parameter,0-Use 1-UnUse(Default: 0):
Searching server...
Connecting server...
Authenticating...
07������ϵ�г�Ӫ�����
��֤�ɹ���
Authenticate SUCCESSFULLY!
Please input 'unauth' to LogOff:
#!/usr/bin/expect
set timeout 10
spawn sudo su
expect "[sudo] password for xxx:"
send "xxx\r"
spawn ifconfig eth0 222.17.xxx.xxx
spawn xrgsu -d
expect "Please input your user name:"
send "xxx\r"
expect "Please input your password:"
send "xxx\r"
expect "Use default auth parameter,0-Use 1-UnUse(Default: 0):"
send "\r"
expect "Please input 'unauth' to LogOff:"
send "unauth\r"
spawn xrgsu -a
expect "Please input your user name:"
send "xxx\r"
expect "Please input your password:"
send "xxx\r"
expect "Use DHCP,1-Use,0-UnUse(Default: 0):"
send "1\r"
expect "Use default auth parameter,0-Use 1-UnUse(Default: 0):"
send "\r"
expect "Please input 'unauth' to LogOff:"
sleep 360000
#end
但是不行。。。请各位帮下忙