Skip to content

Instantly share code, notes, and snippets.

@nkirnos
Created March 31, 2020 06:48
Show Gist options
  • Select an option

  • Save nkirnos/dd5fb4711f655b1a0c15199f24d5ae2d to your computer and use it in GitHub Desktop.

Select an option

Save nkirnos/dd5fb4711f655b1a0c15199f24d5ae2d to your computer and use it in GitHub Desktop.

Revisions

  1. nkirnos created this gist Mar 31, 2020.
    9 changes: 9 additions & 0 deletions check_load_average.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #/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