Here’s a piece of code that I threw together to quickly access a site on any server. It requires that Tcl be loaded on your local machine and a batch file to execute the script. This allows me to quickly launch the GUi into any site on any server (including sites not listed in the server.ini).
The short explanation is that it reads your client.ini to get a list of previously accessed hosts. You select a host and then it gets a list of sites from the server.ini on said server. Select a site by number or name and it then edits your client.ini and launches the GUI.
Let me know if there are any questions. Feel free to use at your own risk.
Steve
#! C:/Tcl/bin/tclsh85
package require ftp
set FH [open C:/quovadx/qdx5.7/integrator/client/client.ini r]
set data [read $FH]
close $FH
set data [split $data n]
set index [lsearch $data “hosts=*”]
set hostList [lindex $data $index]
set hostList [lindex [split $hostList =] 1]
set hostList [split $hostList ,]
set hostItem “”
while { $hostItem == “” } {
puts “ttSelect Host Servern”
set cnt 0
foreach host $hostList {
incr cnt
set hostArray($cnt) $host
puts “tt$cnt) $hostn”
}
puts -nonewline “tChoose host number or type in hostname: ”
flush stdout
gets stdin hostItem
if { ($hostItem == “”) || ($hostItem > $cnt) } {
set hostItem “”
continue
}
if { [string length $hostItem] == “1” } {
set host $hostArray($hostItem)
} else {
set host $hostItem
}
}
set user “username”
set passwd “password”
set remoteDir “/quovadx/qdx5.7/integrator/server”
set FTP [ftp::Open $host $user $passwd]
ftp::Cd $FTP $remoteDir
ftp::Get $FTP server.ini -variable serverData
ftp::Close $FTP
set serverData [split $serverData n]
set index [lsearch $serverData “environs=*”]
set line [lindex $serverData $index]
set siteList [lindex [split $line =] 1]
set siteList [split $siteList “;”]
set siteList [lsort $siteList]
set masterSiteList “”
foreach site $siteList {
if { $site == “” } {
continue
}
set site [file tail $site]
lappend masterSiteList $site
}
set siteItem “”
while { $siteItem == “” } {
puts “ttSelect Siten”
set cnt 0
foreach site $masterSiteList {
incr cnt
set siteArray($cnt) $site
puts “tt$cnt) $siten”
}
puts -nonewline “tChoose site number or type in site name: ”
flush stdout
gets stdin siteItem
# Comment out the ‘if’ and close brace if you want to access a site that’s
# not in the server.ini file
#if { [lsearch -exact $masterSiteList $siteItem] != “-1” } {
set site $siteItem
break
#}
if { ![string is digit $siteItem] } {
puts “string is not a digit”
set siteItem “”
continue
}
if { ($siteItem == “”) || ($siteItem > $cnt) } {
set siteItem “”
continue
} else {
set site $siteArray($siteItem)
}
}
set index [lsearch $data “last_host=*”]
set newLine “last_host=$host”
set data [lreplace $data $index $index $newLine]
set index [lsearch $data “last_environ=*”]
set newLine “last_environ=/quovadx/qdx5.7/integrator/$site”
set data [lreplace $data $index $index $newLine]
set data [join $data n]
set FH [open C:/quovadx/qdx5.7/integrator/client/client.ini w]
puts $FH $data
close $FH
exec c:/quovadx/qdx5.7/integrator/clgui/bin/hciaccess.exe &
exit