kilabor/ssh_connect.expect

20 lines
349 B
Text
Raw Normal View History

2026-03-26 22:00:03 +00:00
#!/usr/bin/expect -f
set timeout 15
2026-04-07 21:12:28 +00:00
spawn ssh -o StrictHostKeyChecking=accept-new $IONOS_HOST
2026-03-26 22:00:03 +00:00
expect {
"*?assword:*" {
2026-04-07 21:12:28 +00:00
$IONOS_SSH"
2026-03-26 22:00:03 +00:00
}
timeout {
puts "Timeout waiting for password prompt"
exit 1
}
}
expect -re {[$#>] }
send "find . -maxdepth 4 -name 'wp-content' -type d\r"
expect -re {[$#>] }
send "exit\r"