#!/bin/sh

while :
do
    stillRunning=$(ps -e |grep KonkeKangJia)
    if [ "$stillRunning" ] ; then
        echo "KonkeKangJia is running."
    else
        echo "try to start KonkeKangJia"
        killall KonkeKangJia
        sleep 1
        mv /tmp/KonkeKangJia/bin/KonkeKangJia /home/hj/KonkeKangJia/bin/
        mv /tmp/KonkeKangJia/config/hj_hwprofile.json /home/hj/KonkeKangJia/config/
        sh /home/hj/KonkeKangJia/bin/start.sh &
    fi  
    sleep 60
done
