From 8d01e4fd330f2230187ff6188c3b0a1b54db1d2c Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 1 Sep 1999 13:08:20 +0000 Subject: [PATCH] allow config via config file --- hadaq/cmds.tcl | 10 +++++++--- hadaq/hadaq_init.tcl | 7 ++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hadaq/cmds.tcl b/hadaq/cmds.tcl index 4e082dc..f261283 100644 --- a/hadaq/cmds.tcl +++ b/hadaq/cmds.tcl @@ -1,10 +1,12 @@ -proc createAgent {agent} { +proc createAgent {agent args} { global agents global agentList lappend agentList $agent set agents($agent.name) $agent set agents($agent.host) $agent + set agents($agent.user) [eval lindex $args 0] + set agents($agent.dir) [eval lindex $args 1] set agents($agent.status) down } @@ -14,6 +16,8 @@ proc deleteAgent {agent} { unset agents($agent.name) unset agents($agent.host) + unset agents($agent.user) + unset agents($agent.dir) unset agents($agent.status) set agentList [lreplace $agentList [lsearch $agentList $agent] [lsearch $agentList $agent]] } @@ -70,7 +74,7 @@ proc listAgent {agent what } { global agents if {$what == {}} { - set what {name host status} + set what {name host user dir status} } foreach i $what { catch {unset m} @@ -93,7 +97,7 @@ proc agent {oper {agent {}} {args {}}} { } elseif {"$oper" == "cat"} { catAgent "$agent $args" } elseif {"$oper" == "create"} { - createAgent $agent + createAgent $agent $args } elseif {"$oper" == "connect"} { if {"$agent" == "all"} { while {[agent cat -down] != {}} { diff --git a/hadaq/hadaq_init.tcl b/hadaq/hadaq_init.tcl index cab54c0..13edd37 100644 --- a/hadaq/hadaq_init.tcl +++ b/hadaq/hadaq_init.tcl @@ -4,11 +4,12 @@ source [lindex $argv 1] foreach i [agent cat] { set host [agent list $i host] - set user root - set dir /home/hades/ht99/daq/hadaq + set user [agent list $i user] + set dir [agent list $i dir] puts $host - if {[string match "hades19" $host]} { + set hostType [ exec rsh $host uname ] + if {[string match "LynxOS" $hostType]} { set psCmd {ps -ax | awk '{ print $1, $NF }'} } else { set psCmd {export UNIX95=XPG4; ps -e -o pid -o comm} -- 2.43.0