set modul "giga4/" set ports 48 set once 3 proc knightInit {} { global modul global ports for {set x 1} {$x<=$ports} {incr x} { ios_config "interface $modul$x" "no shutdown" } } proc knightOne {} { global modul global ports global once for {set x 1} {$x<=$once} {incr x} { ios_config "interface $modul$x" "shutdown" } for {set x [expr $once+1]} {$x<=$ports} {incr x} { set a [expr $x-$once] ios_config "interface $modul$x" "shutdown" ios_config "interface $modul$a" "no shutdown" } for {set x [expr $ports-$once]} {$x>=1} {incr x -1} { set a [expr $x+$once] ios_config "interface $modul$x" "shutdown" ios_config "interface $modul$a" "no shutdown" } } proc knightDo {} { knightInit knightOne knightInit } knightDo