#!/bin/bash 
clear 
prg_check='goalParser' 

prg_check_pid=`ps -A | grep $prg_check` 

if [ -n "$prg_check_pid" ]; then 
echo "web_execute_plugin ../goalAlert/goalSTARTER.plugin" 1 > /dev/commander   
        echo "Programma in esecuzione..." 
        kill -9 `pidof goalParser`
        
        
        
else 
echo "web_execute_plugin ../goalAlert/goalSTARTER.plugin" 0 > /dev/commander 
echo "Programma non in esecuzione..." 
chmod 755 /var/goalAlert/goalParser
/var/goalAlert/goalParser &
    
fi 

   
