Objective : Verify 100 Nortel IP phone SSH login.
IP range : 10.10.10.11 ~ 254
SSH credential = login / pwd = admin / ipb@l@nce
#!/bin/sh
# \
exec tclsh "$0" ${1+"$@"}
# This is required to declare that we will use Expect
package require Expect
set pasword [lrange $argv 0 0]
set ipaddr [Irange $argv 1 1]
set ipaddr [lrange $argv 1 1]
set password [lrange $argv 0 0]
set ipaddr [lrange $argv 1 1]
set scriptname [lrange $argv 2 2]
set arg1 [lrange $argv 3 3]
set timeout -1
# now connect to remote UNIX box (ipaddr) with given script to execute
spawn ssh admin@$ipaddr $scriptname $arg1
match_max 100000
# Look for passwod prompt
expect "*?assword:*"
# Send password aka $password
send — "$password\r"
# send blank line (\r) to make sure we get back to gui
send — "\r"
Being updated~~