Operating System - HP-UX
1832855 Members
2998 Online
110047 Solutions
New Discussion

Re: logging out using Scripts

 
SOLVED
Go to solution
Stefan Saliba
Trusted Contributor

logging out using Scripts

I need to make a script that once it is executed it will automatically log out the user

Does anyone maybe know how to actually log out the user ?
3 REPLIES 3
Tracey
Trusted Contributor

Re: logging out using Scripts

At the end of your script, type:
exit
on a line by itself.
James R. Ferguson
Acclaimed Contributor
Solution

Re: logging out using Scripts

Stefan:

If you want the user to only be able to execute a particular script (as is common with menu-based loops), then either:

1. Substitute the script name in place of the normal shell name in the seventh, colon-delimited field of /etc/passwd.

2. As the last line of the user's $HOME/.profile, do:

exec <script>

This will cause the <script> to run and upon exiting, the user will be logged off.

...JRF...
James H. Trice Ph.D.
Occasional Advisor

Re: logging out using Scripts

Under ksh "kill -HUP $PPID" will kill off the parent process if that is what you are trying to do.
Jim Trice