Last active
August 27, 2019 08:23
-
-
Save ptigas/5dadaf379e87158e12e0169cb7a35ebe to your computer and use it in GitHub Desktop.
shutdown on inactivity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
a=`cut -d ' ' -f 3 /proc/loadavg` set a = load avg. | |
if [ $(echo "$a > 0.25" | bc) -ne 0 ]; then #If load avg. is less than .25 | |
sudo shutdown | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment