Computing.Net > Forums > Linux > How logout from login-menu bash script?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How logout from login-menu bash script?

Reply to Message Icon

Name: Mike Hudson
Date: April 12, 2002 at 10:57:58 Pacific
Comment:

I want to have a simple apps menu, in bash script, for users that don't want access to the shell.

How can I provide a "Logout" option to do the equivalent of 'Ctrl-D' and log the user out of the system instead of just returning to a shell prompt, and also to log the user out if they do Ctrl-C in the menu?

At present I am running the menu script from the users' .bash_profile as follows:-

/usr/bin/menu-script
exit 0

Any other advice on the subject of login menu scripts would be welcome.

Thanks
Mike



Sponsored Link
Ads by Google

Response Number 1
Name: Danny Larouche
Date: April 12, 2002 at 12:01:07 Pacific
Reply:

Set this script as the default shell in the /etc/passwd file. Its simple and secure.

Second option is to call it with "exec"

exec /usr/bin/menu-script

exec will replace the current shell with itself.


0

Response Number 2
Name: Mike Hudson
Date: April 13, 2002 at 05:03:12 Pacific
Reply:

Thanks Danny
I think it would have taken weeks of reading to find those answers!
Mike


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: How logout from login-menu bash script?

Need Help with Basic Bash Script www.computing.net/answers/linux/need-help-with-basic-bash-script/18382.html

Logout from bash shell www.computing.net/answers/linux/logout-from-bash-shell/11711.html

bash script www.computing.net/answers/linux/bash-script/28101.html