First the situation:
I have a server that I want to shutdown automatically at night (00:00), but I need to make sure no one is logged via ssh in still. If they are, then I will allow up to another hour for a second shutdown attempt (01:00) at which time the server goes down no matter what.
I figure I can just go with a cron job for shutdown (unless there's a better way to schedule shutdowns), but wouldn't know how to implement the check in the first case.
Is there a way to know if a user is actively using his samba share, and in this case, not complete the shutdown procedure. Or better yet, check if there is a healthy amount of Disk I/O that will also not complete the shutdown.
I have seen some answers already that can help me out, so I wish to know specifically, what would be the best way to accomplish this as a whole, without hacking up different bits and pieces.