#TODO: Replace the following basic code with some code that kills all child processes (this code only kills the current child pid it's aware of via WaitFor(Task)Completion
if ps -p $CHILD_PID > /dev/null 2>&1
then
kill -s SIGTERM $CHILD_PID
if[$?==0];then
Logger "Stopped child process [$CHILD_PID].""DEBUG"
else
Logger "Could not terminate child process [$CHILD_PID]. Trying the hard way.""DEBUG"
kill -9 $CHILD_PID
if[$? !=0];then
Logger "Could not kill child process [$CHILD_PID].""ERROR"
fi
fi
fi
#TODO: Check new KillChilds function for service mode
if ps -p $OSYNC_SUB_PID > /dev/null 2>&1
then
kill -s SIGTERM $OSYNC_SUB_PID
if[$?==0];then
Logger "Stopped sub process [$OSYNC_SUB_PID].""DEBUG"
else
Logger "Could not terminate sub process [$OSYNC_SUB_PID]. Trying the hard way.""DEBUG"
kill -9 $OSYNC_SUB_PID
if[$? !=0];then
Logger "Could not kill sub process [$OSYNC_SUB_PID].""ERROR"
fi
fi
fi
# if ps -p $OSYNC_SUB_PID > /dev/null 2>&1
# then
# kill -s SIGTERM $OSYNC_SUB_PID
# if [ $? == 0 ]; then
# Logger "Stopped sub process [$OSYNC_SUB_PID]." "DEBUG"
# else
# Logger "Could not terminate sub process [$OSYNC_SUB_PID]. Trying the hard way." "DEBUG"
# kill -9 $OSYNC_SUB_PID
# if [ $? != 0 ]; then
# Logger "Could not kill sub process [$OSYNC_SUB_PID]." "ERROR"