#!/bin/sh

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