LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-21-2019, 11:06 PM   #1
abakwa
LQ Newbie
 
Registered: Jan 2019
Posts: 2

Rep: Reputation: Disabled
Creating a login menu that set a users environment.


Hello all

I have searched this site and although I have found some scripts to create login menus, none of these scripts seem to do what I am looking for. Most of the scripts will perform a specific task and then loop back to the main menu.

What I am looking for it that the login menu should set a user's environment and then proceed to the environment in the same terminal.

Say I have to environments on the same server:
1. A database environment.
2. An application environment.

When a user logs into the server I want the user to be presented with a menu to select their environment. If the user selects 1 for database environment then a bash profile is executed for the database environment and the user can continue in the same terminal.

At any point in the terminal, the user can type "main menu" to bring back the login menu so they can make a new selection.

Thanks for your help.
 
Old 01-22-2019, 01:09 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
so which files are being parsed at login?
on my system it's ~/.bash_profile amongst others.
it's a normal bash script, you can add your menu functionality there.

Quote:
Originally Posted by abakwa View Post
At any point in the terminal, the user can type "main menu" to bring back the login menu so they can make a new selection.
that won't be easy.
why not just log out/in again?
 
Old 01-22-2019, 12:25 PM   #3
abakwa
LQ Newbie
 
Registered: Jan 2019
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
so which files are being parsed at login?
on my system it's ~/.bash_profile amongst others.
it's a normal bash script, you can add your menu functionality there.


that won't be easy.
why not just log out/in again?

I also use the ~/.bash_profile and I have seen it done in another environment. Regret not to have copied the script. lol

These servers sometimes have 4-5 different things running on them. Just trying to find an easy way to switch between user environments by using a menu to execute the ~/.bash_profile behind the scene.

Thanks for replying.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script with Menu and sub menu and in sub menu execute another shell script SHWE Linux - Newbie 9 11-03-2018 06:19 PM
[SOLVED] problem creating KDE menu items that actually show up in the menu SharpyWarpy Linux - Desktop 3 07-03-2012 08:28 PM
"login window" menu is gone on Alacarte Menu? cqmyg5 Ubuntu 0 03-02-2007 06:35 PM
How to set default Desktop environment while creating user accounts?? mayank_a Linux - Software 5 10-05-2005 06:26 AM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 02:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration