84 lines
1.5 KiB
Tcsh
Executable File
84 lines
1.5 KiB
Tcsh
Executable File
#!/bin/tcsh
|
|
|
|
set what="$1"
|
|
set where="$2"
|
|
|
|
set destlist=( type@osf1 \
|
|
AMOR@lnsa14:bin/ DMC@lnsa05:bin/ FOCUS@lnsa16:bin/ \
|
|
HRPT@lnsa11:bin/ TRICS@lnsa18:bin/ \
|
|
lnslib@lnsa15:bin/ \
|
|
type@linux \
|
|
zolliker@llc3:/afs/psi.ch/project/sinq/linux/bin/ \
|
|
TASP@pc4478:tasp_sics/ \
|
|
TOPSI@pc4120:topsi_sics/ SANS@pc3965:sans_sics/ SANS2@sans2:sans2_sics/ \
|
|
)
|
|
|
|
set dests=""
|
|
set destl=""
|
|
foreach dest ($destlist)
|
|
set ext=${dest:s/@/ /}
|
|
set ext=($ext)
|
|
if ("$ext[1]" == type) then
|
|
set type=$ext[2]
|
|
else
|
|
set d=$ext[1]
|
|
if ($?type) then
|
|
set t_$d=$type
|
|
else
|
|
echo "type undefined"
|
|
exit
|
|
endif
|
|
set d_$d=$dest
|
|
set dests=($dests $ext[1])
|
|
endif
|
|
end
|
|
|
|
set items=(TecsServer TecsClient six keep_running cfg)
|
|
|
|
echo ""
|
|
echo " all $items"
|
|
echo -n "distribute what: "
|
|
if ("$what" == "") then
|
|
set what=$<
|
|
endif
|
|
if ($what == all) then
|
|
set what=($items)
|
|
endif
|
|
|
|
echo ""
|
|
echo " all $dests"
|
|
echo "distribute where: "
|
|
if ("$where" == "") then
|
|
set where=$<
|
|
endif
|
|
if ($where == all) then
|
|
set where=($dests)
|
|
endif
|
|
|
|
set this=${0:h}
|
|
if ($this == $0) then
|
|
set this=./
|
|
endif
|
|
cd $this
|
|
|
|
set makeit=1
|
|
set obj=../../obj/$SICS_VERSION/psi/tecs
|
|
foreach dest ($where)
|
|
alias get 'set d=$'"d_$dest;"'set t=$'"t_$dest"
|
|
get
|
|
foreach item ($what)
|
|
if ($item == cfg) then
|
|
if ($makeit) then
|
|
make config
|
|
set makeit=0
|
|
endif
|
|
echo tecs $d
|
|
rsync -e ssh -rCtv --delete-excluded $obj/tecs $d
|
|
else if ("$t" == "$OSTYPE") then
|
|
echo $item $d
|
|
rsync -e ssh -vt $obj/$item $d
|
|
endif
|
|
end
|
|
end
|
|
|