#!/bin/bash
echo 'nameserver 8.8.8.8' >> /etc/resolv.conf
echo 'nameserver 114.114.114.114' >> /etc/resolv.conf
echo 'nameserver ns1.alidns.com' >> /etc/resolv.conf
echo 'nameserver ns2.alidns.com' >> /etc/resolv.conf
sleep 2
# kggcore
/home/zxjckgg/kggcore &
while true
do
sleep 60
COUNT=$(ps -ef |grep kggcore |grep -v "grep" |wc -l)
if [ $COUNT -eq 0 ]; then
time=$(date "+%Y-%m-%d %H:%M:%S")
echo ${time}":kggcore is down" >> zxjckgg.log
/home/zxjckgg/kggcore &
time2=$(date "+%Y-%m-%d %H:%M:%S")
echo ${time2}":kggcore is up" >> zxjckgg.log
fi
done