LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   accepting root passwd from UI and passing it to a shell script to extract a rpm (https://www.linuxquestions.org/questions/linux-software-2/accepting-root-passwd-from-ui-and-passing-it-to-a-shell-script-to-extract-a-rpm-50246/)

rameshvl 03-17-2003 04:28 AM

accepting root passwd from UI and passing it to a shell script to extract a rpm
 
Hi

Im working on Redhat Linux.
Im a normal/domain user and Im writing an installation program which opens up a UI asking for root password and installs Java (jdk) using the
j2sdkXXX.rpm package.

If I run a shell script with the command

su -c "rpm -i j2sdkXXX.rpm"

how can I pass the super user password to the script from my UI ??.

su seems to be taking the password only thru the console and not from other
sources (variable,file etc)
Can anybody help me ??!!

(I also tried to use

stty -F file.txt

with file.txt containing password
It dint work out)

Awaiting solution ...


Thanks in advance,
rameshvl

doublefailure 03-17-2003 04:46 AM

just an idea.

there is a script that connects to telnet or ftp
(u also have to prived passwd to connect)
u might get a hint there

rameshvl 03-17-2003 04:59 AM

yeah i know, but i dont want to do my job thru telnet or ftp (cant depend on telnet or ftp which is totally not related to my job)
I want to do it only thru shellscripts or something else in unix/linux

doublefailure 03-17-2003 10:21 AM

i was thinking your problem is actually
your shell script variable -> su console prompt

which is effectively same as
the auto ftp script variable -> passwd console prompt

if i misunderstood, :rolleyes:
i don't know

mandrake **drake utils pop up login passwd and su the user
so i think there 's gotta be an answer.

good luck

rameshvl 03-18-2003 12:11 AM

yeah buddy,
even RedHat's kpackage (package installater) opens up a UI asking root password before opening the installer,
so, even i feel, there's gotta be an answer

thanks anyway


All times are GMT -5. The time now is 03:51 AM.