#!/bin/sh
#
#
#
flag=""
while [ -z "$flag" ]; do
  expert_pid=`ps -aelf | grep -v grep | grep python | grep ExecutiveSystem | awk '{print $4}' | head -1`
  echo ${expert_pid}
  if [ -n "${expert_pid}" ]; then  
    #
    # Firts a gentle kill...
    #
    kill $expert_pid 
    sleep 1
    expert_pid2=`ps -aelf | grep -v grep | grep python | grep ExecutiveSystem | awk '{print $4}' | head -1`
    if [ "$expert_pid" = "$expert_pid2" ] ; then
      #
      # Still alive? Then bring out the big guns!
      #
      kill -9 $expert_pid 
    fi
    echo "Killed executive system"
  else
    flag="true"
  fi 
done


