expect script, how to deal with different outputs.

I have an expect script that I need to deal with a few different outputs? Here are the commands I am running

ssh -o StrictHostKeyChecking=no root@$ipaddress "racadm config -g cfgIpmiLan -o cfgIpmiLanEnable 1"

Now, the system I am running this from if I have connected to the server before I immediately get the password prompt; if not I get an addition message "Warning: Permanently added '10.183.188.15' (RSA) to the list of known hosts."

How can I handle getting that message? Im not too familiar with tcl scripting so Im not sure how to look for that message and ignore it.

Oh, and ssh keys are not an option asdell drac's dont have any type of keygen or .ssh/authorized_keys directory that I know of. Besides that I would still need an expect script to get them initially setup :o

#!/usr/bin/expect -f

set ipaddress [lindex $argv 0]
set passwd [lindex $argv 1]

set timeout -1
spawn ssh -o StrictHostKeyChecking=no root@$ipaddress {racadm config -g cfgIpmiLan -o cfgIpmiLanEnable 1}
match_max 100000
expect -exact "root@$ipaddress password: "
send -- "$passwd\r"
expect eof

---------- Post updated 05-21-10 at 08:36 AM ---------- Previous update was 05-20-10 at 10:05 AM ----------

ok, lots of googling and I found an answer...

this is basically an expect case/loop thingy...

#!/usr/bin/expect -f

set ipaddress [lindex $argv 0]
set passwd [lindex $argv 1]

set timeout -1
spawn ssh -o StrictHostKeyChecking=no root@$ipaddress {racadm config -g cfgIpmiLan -o cfgIpmiLanEnable 1}
expect { 
  "Warning: *" {
     exp_continue
  }
  "root@${ipaddress}'s password: " {
  send "${passwd}\r"
  }
}

expect eof

exp_continue, continues the loop/case thing to look for more matches...