Carter,
I’ve created a tcl proc that works well:
proc switchSite { siteName } {
global env
set bolSiteSwitched 0
if { ! [catch {eval [exec ${::env(HCIROOT)}/sbin/hcisetenv -site tcl $siteName]} ] } {
setHciDirs
set bolSiteSwitched 1
}
return $bolSiteSwitched
}
You still will not be able to do what you want using the msi commands for all sites from within the same script. Once you run the msiAttach command for a site from within tcl QDX does not provide anything to unattach from the current site and reattach after you set to a new site.
What I did was copied the hciconnstatus command and changed the emitSummary proc to return a space seperated string of all connections.
proc emitSummary { data } {
set lstConnList [list]
foreach entry $data {
lassign $entry process conn state pstatus time
lappend lstConnList $conn
}
puts [split $lstConnList]
}
I then exec my copy of hciconnstatus to get my list of connections.
Hope this helps,
John Mercogliano
Sentara Healthcare
Hampton Roads, VA