#!/usr/bin/expect -f
#
# $Header: initializeDAB 1.1 2006/06/26 13:11:32MDT Brian Szmyd (bszmyd) dev  $
#
# $ADICCopyright: Copyright 2007 Quantum Corp. $
#
# $Log: initializeDAB  $
# Revision 1.1 2006/06/26 13:11:32MDT Brian Szmyd (bszmyd) 
# Initial revision
# Member added to project e:/mks/projects/predator/ccDevModel/Code/Applications/Scalar101/S101SystemBuild/project.pj
#

# Globals
# --------------
set DAB_PROMPT "> $"
set DAB_RESETCMD "initializeBox 1248\r"
# --------------

# Do not send output from our spawned process to STDOUT
log_user 0

# Run the reset command on each blade in the argument list
foreach IP $argv {
    spawn telnet $IP
    expect $DAB_PROMPT
    send $DAB_RESETCMD
    expect {
        $DAB_PROMPT     { puts "$IP has been reset." }
        "errno"         { puts "$IP failed to be reset." }
    }
    close $spawn_id
}
