run: power off only the port which was switched on

This commit is contained in:
Alexander Boettcher 2013-06-12 13:54:52 +02:00 committed by Norman Feske
parent 27b6839ee0
commit 1b60fd6147

View File

@ -655,14 +655,13 @@ rename exit power_plug_off_exit
proc exit {{status 0}} {
global run_target
if {[regexp "reset" $run_target]} {
set power_port [get_cmd_arg --reset-port 1]
set connection_id [power_plug_connect]
for { set i 0 } { $i < 4 } { incr i } {
puts "switch port $i off"
send -i $connection_id "port $i 0\n"
puts "switch port $power_port off"
send -i $connection_id "port $power_port 0\n"
expect -i $connection_id "250 OK"
}
}
power_plug_off_exit $status
}