Changeset 363


Ignore:
Timestamp:
Feb 13, 2012, 9:36:17 PM (13 years ago)
Author:
Rick van der Zwet
Message:

Actaully shutdown whould be nice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misc/power-saver

    r362 r363  
    1717CRON_INTERVAL=5
    1818MAX_LOAD=0.10
    19 MAX_IDLE=60
     19MAX_IDLE=45
    2020
    2121# Abuse this trick to force a quicker shutdown by ignoring some users
    2222IDLE_USER=${1:-1}
     23# Shutdown delay is NOT considered idle time, but just a save guard.
    2324SHUTDOWN_DELAY=${2:-15}
     25
    2426
    2527# Stored as <epoch> <load>
     
    5658
    5759# We are idle for over $MAX_IDLE time, starting shutdown
    58 if [ $IDLE_COUNTS -gt `expr $MAX_IDLE / $CRON_INTERVAL` ]; then
    59   echo shutdown -p "+$SHUTDOWN_DELAY" "Cancel: sudo killall -SIGTERM shutdown"
     60if [ $IDLE_COUNTS -ge `expr $MAX_IDLE / $CRON_INTERVAL` ]; then
     61  shutdown -p "+$SHUTDOWN_DELAY" "Cancel: sudo killall -SIGTERM shutdown"
    6062fi
Note: See TracChangeset for help on using the changeset viewer.