Files
sicspsi/utils/deploysics
Koennecke Mark 2caac1016f Fixed a bug with the eiger monochromator not driving mt when mcv did not drive
Fixed expression searching in sicslogquery
Added proton monitot to tasscan output
Chnaged SICS scripts to reflect the switch from TRICS to ZEBRA
2016-07-01 10:51:37 +02:00

47 lines
1.3 KiB
Tcl
Executable File

#!/usr/bin/tclsh
#----------------------------------------------------------
# A script for deploying SICS servers easily
#
# Mark Koennecke, April 2015
#----------------------------------------------------------
set instlist [list amor boa dmc eiger focus hrpt mars \
morpheus narziss orion poldi rita2 sans sans2 tasp zebra]
proc execCommand {command} {
puts stdout "Doing $command"
set status [catch {eval exec $command} msg]
if {$status != 0} {
puts stdout "ERROR: $msg "
}
}
#-----------------------------------------------------------
proc replaceServer {inst} {
execCommand "ssh ${inst}@${inst} monit stop sicsserver"
execCommand "ssh ${inst}@${inst} monit stop simserver"
execCommand "scp ./SICServer ${inst}@${inst}:${inst}_sics"
execCommand "ssh ${inst}@${inst} rm ${inst}_sics/core.*"
# execCommand "ssh ${inst}@${inst} updatesicscommon"
execCommand "ssh ${inst}@${inst} monit start sicsserver"
execCommand "ssh ${inst}@${inst} monit start simserver"
}
if {[llength $argv] < 1} {
puts stdout "usage:\n\tdeploysics instname| all"
exit 1
}
set inst [lindex $argv]
if {[string compare $inst all] == 0} {
foreach inst $instlist {
replaceServer $inst
}
} else {
replaceServer $inst
}
puts stdout "Done"