How do I make my expect script check if a server is using an ECDSA key and if it is continue with the script otherwise if it's something like RSA quit immediately?
#!/usr/bin/expect
#Usage sshsudologin.expect <host> <ssh user> <ssh password>
set timeout 60
spawn ssh [lindex $argv 1]@[lindex $argv 0]
expect "yes/no" {
send "yes\r"
expect "*?assword" { send "[lindex $argv 2]\r" }
} "*?assword" { send "[lindex $argv 2]\r" }
expect " " { send "sudo su -\r" }
expect " " { send "commands\r" }
expect " " { send "exit\r" }
expect " " { send "exit\r" }
interact