Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make menu timeout 4

Status
Not open for further replies.

lpblauen

Technical User
Dec 2, 2004
193
US
I have a menu for the helpdesk that gives them commands they can run. The problem is when they login and just sit on the menu. I need it to time out after 30 minutes of no activity. In the .profile I have a time out for the user id but when they are in the menu they don't time out. This is what is in the .profile
TO=1800
TIMEOUT=$TO
TMOUT=$TO
export TIMEOUT TMOUT

What do I need to put in the menu to make it time out.
here is the menu
# Name: helpmenu

trap 'print "Problem with Help Desk menu "; exit' HUP INT QUIT STOP

print " 1) Add users"
print " 2) Change password"
print " 3) Logout "
read sel?
while :
do
case "$sel" in
1) . set_accounts
;;
2) . newpass
;;
3) return
;;
esac
print " 1) Add users"
print " 2) Change password"
print " 3) Logout"
read sel?
done
 
After more checking. In AIX there is a logout program but in tru64 there is not. So this works fine in aix but I also need it to work in tru64.
 
typed, untested (ksh-like shell):
trap 'print "Problem with Help Desk menu "; [!]exec kill -9 $PPID' HUP INT QUIT STOP

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
OOps, sorry for the typo.
typed, untested (ksh-like shell):
trap 'print "Problem with Help Desk menu "; [!]exec kill -9 $PPID[/!]' HUP INT QUIT STOP

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Why not just make user's shell be the script? That way, it starts up when they log in; when it exits, the session is over.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top