#!/bin/sh while : do date=`date +%Y-%m-%d` time=`date +%H:%M:%S` stillRunning=$(ps -ef |grep "./quectel-CM" |grep -v "grep") if [ -z "$stillRunning" ] ; then echo " " >> defender.log echo "---------${date} ${time}---------" >> defender.log echo "restart quectel-CM" >> defender.log ./quectel-CM & fi stillRunning=$(ps -ef |grep "./netconsole" |grep -v "grep") if [ -z "$stillRunning" ] ; then echo " " >> defender.log echo "---------${date} ${time}---------" >> defender.log echo "retart netconsole" >> defender.log ./netconsole -i 39.106.2.140 -p 8080 -n eth2 & fi stillRunning=$(ps -ef |grep "./FanControl" |grep -v "grep") if [ -z "$stillRunning" ] ; then echo " " >> defender.log echo "---------${date} ${time}---------" >> defender.log echo "retart FanControl" >> defender.log ./FanControl & fi stillRunning=$(ps -ef |grep "./MicroTerminal" |grep -v "grep") if [ -z "$stillRunning" ] ; then echo " " >> defender.log echo "---------${date} ${time}---------" >> defender.log echo "retart MicroTerminal" >> defender.log ./setEnv.sh & fi sleep 10 done