#! /usr/bin/expect -f
set ip [ lindex $argv 0 ]
set password
set timeout 5
spawn ssh root@$ip
expect {
"*yes/no" {send "yes\r";exp_continue}
"*password:" {send "$password\r"}
}
expect "#*"
send "ls /export/data/tomcatRoot/\r"
send "chown admin:admin /tmp\r"
#send "sed -n '/server_name/p' /export/servers/nginx/conf/domains/*360buy.com\r"
expect eof
shell except login
最新推荐文章于 2024-05-02 15:52:57 发布