This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#crontab entry - replace your_user with your actual user name | |
#*/10 * * * * /home/your_user/idle_shutdown.sh > shutdown_logs.txt | |
#check for established SSH connections | |
SSH_CONNS=`netstat | grep ssh | grep ESTABLISHED` | |
#If None | |
if [ -z "$SSH_CONNS" ] | |
then | |
#wait 5 minutes and check again | |
echo "No SSH Connections. Checking again in 5 minutes" |