Skip to content

Instantly share code, notes, and snippets.

@valentt
Created April 11, 2018 09:39
Show Gist options
  • Save valentt/5d9e7507b5b534dc9c1269ad30914801 to your computer and use it in GitHub Desktop.
Save valentt/5d9e7507b5b534dc9c1269ad30914801 to your computer and use it in GitHub Desktop.
babel-killer.sh
#!/bin/sh
LOAD=$(uptime | sed -n -e 's/^.*average: //p'| sed 's/ //g')
LOAD5=$(echo $LOAD | cut -d ',' -f 2)
LOAD500=$(awk -v var=$LOAD5 'BEGIN{print var * 100}')
[ $LOAD500 -gt 50 ] && reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment