- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to write a special shell menu ?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2005 01:17 AM
05-06-2005 01:17 AM
How to write a special shell menu ?
I need to force all users who login to the servers via such device to run a shell script right after they login, without prompting the commandline, like this:
************************
1. Run Application
2. Change Password
3. Logout
************************
I need to restrict all users to access only the options above, they should not be able to do anything else except the actions above.
How to prevent them from using "Ctrl + C" or something else to break the shell and going into the Prompt. That is, they don't need to run "ls", "vi"... It's a security approach.
And how to return back to such menu after users exit the application ?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2005 01:21 AM
05-06-2005 01:21 AM
Re: How to write a special shell menu ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2005 01:25 AM
05-06-2005 01:25 AM
Re: How to write a special shell menu ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2005 01:28 AM
05-06-2005 01:28 AM
Re: How to write a special shell menu ?
The shell script could also contain 3 case statements corresponding to each of the 3 options that would be available.
I would make this a part of the user .profile.
Check to connection to see if they are connecting via the handheld and if so, put them in the captive environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2005 01:30 AM
05-06-2005 01:30 AM
Re: How to write a special shell menu ?
The users password entry might look something like
user1:password:555:444::/home/user1:/usr/local/bin/menu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2005 01:30 AM
05-06-2005 01:30 AM
Re: How to write a special shell menu ?
In the script put a trap statements.
trap "" 1 2 3 --> ignote trap for signal 1,2 and 3
your code for menus goes here. (user case statements here)
trap 1 2 3 --> trap signals 1,2 and 3 again.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2005 01:53 AM
05-06-2005 01:53 AM
Re: How to write a special shell menu ?
I should create a shell script like below and make that the default shell in the /etc/passwd file
#!/bin/sh
trap '' INT QUIT TERM KILL
while true
do
clear
print " Make your choise:"
print "************************"
print "1. Run Application"
print "2. Change Password"
print "3. Logout"
print "************************"
read choise
case choise in
1)
do this
;;
2)
passwd ${LOGNAME}
;;
3)
logoff
;;
*)
print "choose between 1-3"
;;
esac
done
Cheers,
Renarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2005 05:38 AM
05-06-2005 05:38 AM
Re: How to write a special shell menu ?
stty intr undef;stty stop undef;stty susp undef;stty dsusp undef
Thanks!