#!/bin/sh #cd /usr/src/smartproj/bin while (true) do if [ $(ps aux | grep '\.\/ls' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 ls nohup ./ls >/dev/null & echo "$data ls restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/eds' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 eds nohup ./eds >/dev/null & echo "$data eds restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/aas' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 aas nohup ./aas >/dev/null & echo "$data aas restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/ccs' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 ccs nohup ./ccs >/dev/null & echo "$data ccs restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/ss' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 ss nohup ./ss >/dev/null & echo "$data ss restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/dbs' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 dbs nohup ./dbs >/dev/null & echo "$data dbs restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/tas' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 tas nohup ./tas >/dev/null & echo "$data tas restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/ctl' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 ctl nohup ./ctl >/dev/null & echo "$data ctl restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/was' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 was nohup ./was >/dev/null & echo "$data was restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/rcs' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 rcs nohup ./rcs >/dev/null & echo "$data rcs restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/mcs'| grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 mcs nohup ./mcs >/dev/null & echo "$data mcs restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/grs' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 grs nohup ./grs >/dev/null & echo "$data grs restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/vps' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 vps nohup ./vps >/dev/null & echo "$data vps restart again" >> ../logs/Service.log fi if [ $(ps aux | grep '\.\/bp' | grep -v grep | wc -l) -lt 1 ]; then data=$(date "+%F %u %H:%M:%S ") chmod 777 bp nohup ./bp >/dev/null & echo "$data bp restart again" >> ../logs/Service.log fi sleep 10 done exit 0