Originally Posted by Jyothi.yis
I need a script for shutdown the system automatically if the system is not disturbed for last 10 minutes. Please have a look and help in these regards. By the way i am using RHEL 4 in my system.
RHEL4 is old, and should be updated. And have you looked in the Red Hat knowledgebase, since you're paying for access to it?
And if you need a script, then post what you've written so far and tell us where you're stuck...we'll be happy to HELP
you, but this isn't the place to come to have folks write scripts for you. Also, the question itself is vague...what do you mean by "not disturbed"? Do you mean no mouse movements on the GUI console? No new user logins? What?? If you mean that you want to know if users that are already logged in haven't done anything, that's next to impossible. A user could be running a bash shell, which is always running...and they could just go home and leave it there. They could also run a script in the background which spawns a new shell...which means the original has zero activity, but the user is still doing something. Explain what you mean in detail, and post what you've written.
Originally Posted by puntjuh
A simple google search leads me to the following script which should work for you. If you change the threshold (amount of minutes) to 10, and change the userid for the user you want to check for inactivity, this script should serve your purpose.
Nope, it doesn't.
If you look at the script, it's looking for ONE user ID only.