initial-import: 2026-04-11 21:18:55
This commit is contained in:
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout 30
|
||||
set nas_ip "192.168.2.154"
|
||||
set nas_user "cfdaily"
|
||||
set nas_pass "Ccf7561523"
|
||||
|
||||
spawn ssh $nas_user@$nas_ip
|
||||
|
||||
expect {
|
||||
"Password:" {
|
||||
send "$nas_pass\r"
|
||||
}
|
||||
"password:" {
|
||||
send "$nas_pass\r"
|
||||
}
|
||||
"Are you sure you want to continue connecting" {
|
||||
send "yes\r"
|
||||
exp_continue
|
||||
}
|
||||
timeout {
|
||||
puts "SSH连接超时"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
expect "$ "
|
||||
|
||||
send "cd /volume1/stock/sanguo_vnpy && ls -la scripts/\r"
|
||||
expect "$ "
|
||||
|
||||
send "cd /volume1/stock/sanguo_vnpy && docker ps -a\r"
|
||||
expect "$ "
|
||||
|
||||
send "exit\r"
|
||||
expect eof
|
||||
Reference in New Issue
Block a user