kilabor/ssh_connect.expect
2026-04-07 23:12:28 +02:00

19 lines
349 B
Text

#!/usr/bin/expect -f
set timeout 15
spawn ssh -o StrictHostKeyChecking=accept-new $IONOS_HOST
expect {
"*?assword:*" {
$IONOS_SSH"
}
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"