]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
allow config via config file
authorhades <hades>
Wed, 1 Sep 1999 13:08:20 +0000 (13:08 +0000)
committerhades <hades>
Wed, 1 Sep 1999 13:08:20 +0000 (13:08 +0000)
hadaq/cmds.tcl
hadaq/hadaq_init.tcl

index 4e082dc8304fd81ed7b84ceb33a7f51c67650865..f26128379b11d362856eae5ebe7c6cbe60f5a135 100644 (file)
@@ -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] != {}} {
index cab54c022302ca716cf07767d268a96d38539f69..13edd37e48f42deb58915cb1dcd1b1a7109908fa 100644 (file)
@@ -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}