LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Shell script login command? (https://www.linuxquestions.org/questions/linux-general-1/shell-script-login-command-85003/)

chup 08-23-2003 07:34 PM

Shell script login command?
 
i have a problem. ive created a shell script to perform certain commands to initialize my wlan adapter. but, in order to perform the commands listen in the shell script, you have to be root. is there any way for me to let the script ask for the su pass, and then exec the commands? because when i do it like this:
Code:

su
*wlan_initialize_commands*

it asks for the password, but then just ignores the commands :(

trickykid 08-23-2003 08:39 PM

When are you wanting this script to run, at boot up or when the user logs in? If at boot up, you could put the script in rc.local and won't have to worry about the root password.

The other way mentioned is a security risk, I'm not the greatest on scripting but if you were to put root's password in that script, then your basically giving root's password out.

You could also just set it up so that particular user has access to those given commands in the script..

chup 08-24-2003 10:09 AM

Quote:

You could also just set it up so that particular user has access to those given commands in the script.
will i have to use sudo then, and if i have to use sudo, can you explain it to me a bit?

chup 08-24-2003 06:43 PM

and btw, i cant add the commands to rc.local or any other startup scripts, because i have to unplug and re-plug the adapter before i can use the commands :S :(


All times are GMT -5. The time now is 10:22 AM.