Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
uninstall 1.03 KiB
#!/bin/bash
#
# Uninstall one system

if [ "$#" -ne 2 ];then
	echo "pls state the name of the system to uninstall and the source code directory";
	exit 1;
else
	system=$1;
	srcdir=$2;
fi

upper_system=`echo $system | tr a-z A-Z`
site=`grep site= target/${system}epics/${system}epics*.cmd | sed 's/.*site=\([a-z]*\).*/\1/g'`
if test ${site}no = no; then echo Please make $system first; exit 1; fi
ifo=`grep ifo= target/${system}epics/${system}epics*.cmd | head -1 | sed 's/.*ifo=\([a-zA-Z0-9]*\).*/\1/g'`
gds_node=`grep rmid build/${system}epics/${system}.par | head -1| sed 's/[^0-9]*\([0-9]*\)/\1/'`
datarate=`grep datarate build/${system}epics/${system}.par | head -1| sed 's/[^0-9]*\([0-9]*\)/\1/'`
lower_ifo=`echo $ifo | tr A-Z a-z`
cur_date=`date +%y%m%d_%H%M%S`
echo Removing GDS node ${gds_node} configuration file 
echo /opt/rtcds/${site}/target/gds/param/tpchn_${system}.par
/bin/rm -f  /opt/rtcds/${site}/target/gds/param/tpchn_${system}.par
echo Removing DAQ configuration file
echo /opt/rtcds/${site}/${lower_ifo}/chans/daq/${upper_system}.ini