33 lines
626 B
Tcsh
Executable File
33 lines
626 B
Tcsh
Executable File
#!/bin/tcsh
|
|
if ("$1" == "") then
|
|
set ini="tecs.ini"
|
|
else
|
|
set ini="tecs_$1.ini"
|
|
endif
|
|
cd ~/tecs
|
|
if (! -e $ini) then
|
|
echo ~/tecs/$ini not found
|
|
echo ""
|
|
set all=(tecs*.ini)
|
|
echo "Usage:"
|
|
echo ""
|
|
if ("$all" == "tecs.ini") then
|
|
echo " killtecs"
|
|
else
|
|
echo " killtecs <version>"
|
|
echo ""
|
|
echo "where <version> is one of"
|
|
echo ""
|
|
echo ${all:as/tecs_//:as/.ini//}
|
|
endif
|
|
exit
|
|
endif
|
|
set nums=`ps x | grep "TecsServer $ini" | grep -v grep | cut -b 0-6`
|
|
if ("$nums" == "") then
|
|
echo "TecsServer $1 is not running"
|
|
else
|
|
kill -9 $nums
|
|
echo "TecsServer $1 killed (processes $nums)"
|
|
endif
|
|
|