#!/bin/bash Cluster=`cnmon info | grep "Cluster 0"` info=${Cluster} b=${info//[A-Za-z :]/} temp=${b:1} echo "temp:$temp℃" use_rate=`cnmon | sed -n '8p' | awk -F '[ %]+' '{print $10}'` echo "cn use rate:$use_rate%" if [ $temp -gt 85 ] then ehco "Temperature is too high, Portal algorithm service" docker stop gsd_cnstream_1 exit 1 else if [ $use_rate -eq 0 ] then echo "CNMON service stops, restart." cd /opt/GSD docker-compose restart exit 1 else exit 0 fi fi