- Timestamp:
- Feb 13, 2012, 9:36:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/power-saver
r362 r363 17 17 CRON_INTERVAL=5 18 18 MAX_LOAD=0.10 19 MAX_IDLE= 6019 MAX_IDLE=45 20 20 21 21 # Abuse this trick to force a quicker shutdown by ignoring some users 22 22 IDLE_USER=${1:-1} 23 # Shutdown delay is NOT considered idle time, but just a save guard. 23 24 SHUTDOWN_DELAY=${2:-15} 25 24 26 25 27 # Stored as <epoch> <load> … … 56 58 57 59 # We are idle for over $MAX_IDLE time, starting shutdown 58 if [ $IDLE_COUNTS -g t`expr $MAX_IDLE / $CRON_INTERVAL` ]; then59 echoshutdown -p "+$SHUTDOWN_DELAY" "Cancel: sudo killall -SIGTERM shutdown"60 if [ $IDLE_COUNTS -ge `expr $MAX_IDLE / $CRON_INTERVAL` ]; then 61 shutdown -p "+$SHUTDOWN_DELAY" "Cancel: sudo killall -SIGTERM shutdown" 60 62 fi
Note:
See TracChangeset
for help on using the changeset viewer.