#!/bin/bash
# GRID-TLSE shell scripts :

# killing SeD/MA/omniNames process and cleaning log files on MA computer
echo "Killing SeD..."
killall DIET_TLSE_SeD
killall DAGDA_TLSE_SeD
sleep 2

echo "Killing dietAgent..."
killall dietAgent
sleep 2

echo "Killing omniNames..."
killall omniNames
sleep 2

if [ -z "${TLSE_SERVICE_PATH}" ]
then
  echo "TLSE_SERVICE_PATH undefined"
else
  echo "Cleaning log traces..."
  rm -rf ${TLSE_SERVICE_PATH}/log/*
fi


if [ -z "${TLSE_DAGDA_PATH}" ]
then
  echo "TLSE_DAGDA_PATH undefined"
else
  echo "Cleaning DAGDA matrices..."
  rm -rf ${TLSE_DAGDA_PATH}/MA/*
  rm -rf ${TLSE_DAGDA_PATH}/SeD/*
fi

sleep 3
