#/bin/bash load=$(cat /proc/loadavg | awk '{ print $2}') threshold=0.3 echo $load check=$(echo "$threshold > $load" | /usr/bin/bc) if test "$check" = "1"; then sudo /sbin/shutdown now fi