#!/bin/sh temp1=50 temp2=90 temp=$(nvidia-smi | grep 'Default' | awk '{print $2}' | sed 's/%//') if [ "$temp" -ge "$temp2" ] ; then echo "Gpu: $temp%" elif [ "$temp" -ge "$temp1" ] ; then echo "Gpu: $temp%" else echo "Gpu: $temp%" fi