#!/usr/bin/expect -- #term_to_spare.ex (MAC) #Note: the file .kermrc has the command "prompt k>>" # KERMIT CONNECTION TO PDS752 COM ? log_user 0 # IP number and port number set ip [exec getsetupinfo "setup/su.txt" "IBOOT IP"] if { $ip == 0 } { send_user "1"; exit 1 } # START PROCESS -- KERMIT FOR MODEM spawn telnet $ip set PDS $spawn_id set timeout 4 expect { timeout {"TELNET FAILS TO OPEN\n"; exit 1} "User>" } send "admin\r\n"; expect { "Password>" } send "admin\r\n"; expect { "iBoot>" } send "set outlet off\r" expect { "iBoot>" } send "get outlet\r" expect { "On" {send_user "Power is ON.\n"} "Off" {send_user "Power is OFF.\n"} } send "logout\r" send_user "0"; exit 0