#!/bin/sh
sleep 2
while [ 1 ]
do
Num=`ps -ef | grep -v grep | grep app| wc -l`
if [ $Num -eq 0 ];then
/home/app > /dev/null 2>&1 &
elif [ $Num -gt 1 ];then
kill -9 `ps -ef | grep -v grep | grep tscr_hmi | awk '{print $2}'` > /dev/null 2>&1 &
/home/app > /dev/null 2>&1 &
else
sleep 1
fi
done