Skip to content

Instantly share code, notes, and snippets.

@betrcode
Created December 4, 2012 10:52
Show Gist options
  • Save betrcode/4202626 to your computer and use it in GitHub Desktop.
Save betrcode/4202626 to your computer and use it in GitHub Desktop.
TCL Expect script to turn ON/OFF a switch on a iTach WF2CC, to be called from Jenkins in a post build action (usage: tclsh build-failed.tcl)
#!/bin/sh
# \
exec tclsh "$0" ${1+"$@"}
package require Expect
set exp::winnt_debug 1
puts stdout "Connecting to iTach and turning it ON\n"
spawn plink -telnet 1.3.3.184 -P 4998
expect "Escape character is '^]'."
send "setstate,1:2,1\r"
expect "setstate,1:2,1"
#!/bin/sh
# \
exec tclsh "$0" ${1+"$@"}
package require Expect
set exp::winnt_debug 1
puts stdout "Connecting to iTach and turning it OFF\n"
spawn plink -telnet 1.3.3.184 -P 4998
expect "Escape character is '^]'."
send "setstate,1:2,0\r"
expect "setstate,1:2,0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment