Skip to content

Commit

Permalink
Shut down with a load average below 0.05
Browse files Browse the repository at this point in the history
  • Loading branch information
waldoj committed Jan 17, 2024
1 parent 93090ec commit c156938
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deploy/monitor_load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LOAD_AVERAGE="$(uptime | sed 's/.*load average: //' |cut -d " " -f 1 |grep -oE "
# Multiply it by 100 and round it
LOAD_AVERAGE=$(echo "$LOAD_AVERAGE * 100" | bc | awk '{print int($1+0.5)}')

# If the load average is less than 0.02, shut down
if [ "$LOAD_AVERAGE" -le 2 ]; then
# If the load average is less than 0.05, shut down
if [ "$LOAD_AVERAGE" -le 5 ]; then
shutdown -h now
fi

0 comments on commit c156938

Please sign in to comment.