Tech Support Forum banner

Shell Script Problem

1166 Views 5 Replies 3 Participants Last post by  antrieb
I need to create a shell script that controls the users runlevel at every startup/logon of the linux system. the user should be prompted with a menu screen taht asks for their desired runlevel. The user should be presented with the following 3 choices:
¤ Single User Mode
¤ Full/Extended Multi-User Mode
¤ Graphical/XII Mode
The user should be "started up" in any one of these modes based on their "numerical" reponse. In addition there are certain runlevels that shouldn't be used. the script should also provide for the condition that the user might "erroneously" respond with these unsafe runlevels. In such cases the script should prevent the system from entering these runlevels & instead give a message like "Invalid Choice, Try Again!"
------------------------------------------------------------
Now I'm sure their is a shell scripting guy who can whip this up in a few minutes. And thats exactly what I'm looking for. I need this done for him by tommorow. I really hope comming to these forums was the right choice becuase I'll be screwed if I can not figure this out. THankx "Tech Support Forums!!!"
Status
Not open for further replies.
1 - 6 of 6 Posts
Well, for starts what is your distro?

And I'm not sure if a shell script is fully capable of that. You may need to code it in a high level language such as C.

Also, have you tried google?
fedora core or i could use suse.... this should not need anything that advanced. its not hard, i just cant remember it all. and i have no time to research
It is not possible to do it with a shell script. Your shell script can't run until the computer is booted up. Are you using Grub or Lilo.

If you are running Lilo, at the boot prompt you can just type the boot label and the runlevel you want to go to.

So if you wanted to go into runlevel three you would type: linux 3.

You can edit the /boot/message file to display what the users can type at the Lilo prompt.

YOu could also edit your lilo.conf file to create new labels so you could have them type a more descriptive label. For example, if you wanted them to go into X server, you could create an entry in your lilo.conf file with the label X. Then they could just type X at the lilo prompt.
Good point Squashman, I dont know what I was thinking.

I'm pretty sure FC and suse use grub.
hm... worked.. i guess i should of just did that in the first place, when he asked me to make it i didn't even think that there was more then one way to skin a cat... thanks !!!
1 - 6 of 6 Posts
Status
Not open for further replies.
Top