自動登錄過BSO腳本 ( by quqi99 )
#!/usr/bin/expect
set username "****@163.com"
set password "password"
#Passing one of the IPs bellow maybe pass others.
set ip_list {
vs370.rch.kstart.com
9.123.100.210
}
set timeout 5
foreach {ip} $ip_list {
if [catch {
spawn telnet $ip
expect "Username:"
send "$username\r"
expect "Password:"
send "$password\r"
#wait to authenticate
expect {
"Successful" {puts "pass bso for $ip sucessfully."}
timeout {puts "you maybe have passed bso for $ip sucessfully."}
}
close
} result] {
puts "you maybe have passed bso for $ip sucessfully."
}
}
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。