I have a server that I use infrequently, so I'd like to cron
a job to shutdown daily if no users are logged in via SSH and SAMBA shares.
How can I determine how many active SSH connections there are, and how many active SAMBA connections there are?
If both of these values are zero, the cron script will shutdown the server.