A script for linux or unix. Will shutdown the server after inactivity is detected. Written for Nas4free but may work on other OS too. Can send also email if system will be shutdown.
The system will not shutdown if:
- a ZFS scrub or a resilver is in progress
- uptime is less then specified minutes
- avg cpu load in last 1min, 5min, 15min igher than specified
- any http or ssh session is active, this includes snapshots sent/received over ssh
- more SMB connections than specified...