Using a request script


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Using a request script
# 1  
Old 04-01-2008
Using a request script

I am creating a package(Solaris10 on sparc) that needs user input.
As I understand it, I need to use a request script.

My problem is that the value I set in my request script is not visible in my postinstall script. Not sure if I am doing it right.

Here is an example request script
Code:
#!/bin/sh
LOGHOSTSRVR=""
echo "Which loghost server do you want to use, loghostdr or loghostprd: "
read LOGHOSTSRVR

# export LOGHOSTSRVR to global PKG environment
cat >> $1 << EOT
LOGHOSTSRVR=${LOGHOSTSRVR}
EOT

In my postinstall script, if I echo $LOGHOSTSRVR it is empty

Has anyone successfully created a package that uses a request script ?
Your help is much appreciated.
Tornado
# 2  
Old 04-01-2008
What is $1 in this code?

What is the relationship between this code and your other script?

Where and how do you "echo" in there?
# 3  
Old 04-01-2008
The value of $1 is the installers answer.
ie:
If the user answers loghostdr then $1 is
LOGHOSTSRVR=loghostdr

The request script is part of a package that I am building.

There are six types of scripts you can create when creating a Solaris package. You do not need to have all these scripts, you only use what you need. The scripts get run in the following order.

1. request
2. checkinstall
3. preinstall
4. postinstall
5. preremove
6. postremove

My package does not use a checkinstall script, but it does have the rest.

The request script is what is used if user interaction is needed and the values should be made available to any of the following scripts.

In my postinstall script I have added echo statements to see what values it knows about.

echo $1
echo $LOGHOSTSRVR

These are both empty.. I have tried to export the value in the request script aswell with no success.

I need help from someone that knows about creating Solaris packages and that has created packages that need to have a request script.
Tornado
# 4  
Old 04-01-2008
Tornado,

The script itself looks fine to me. Remember $1 is not the user answer, it is the location of the temporary response file. An important point however is that every environment variable that you set should be defined in the pkginfo file.
# 5  
Old 04-01-2008
You are spot on.. Adding LOGHOSTSRVR to pkginfo has fixed my issue

Thanks for that.
Tornado
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Request per second script

Hello; I'm having about 800 log files and i'm trying to write a script that report the counts of lines per second or "requests per second" in each log file and report the output which includes the timestamp for the highest lines per second count and the log file name and the highest number per... (5 Replies)
Discussion started by: Katkota
5 Replies

2. Shell Programming and Scripting

Formatting wget request within script

When using a browser and calling this url .. the data returns the proper range of information ichart dot finance dot yahoo dot com/table.csv?s=YAHOO&a=3&b=14&c=2012&d=03&e=20&f=2012&g=d&ignore.csv (geeze wont let me post url's sorry ) However in my script the formatting is messing up on... (4 Replies)
Discussion started by: harte
4 Replies

3. Shell Programming and Scripting

Shell script request

I've a master file which will contain 100 file names, The script should read file name from a master file and format the file as below in AIX. input file Filename This is a test file Output File Filename|This is a test file Thanks in advance for file in $FileList; do (5 Replies)
Discussion started by: udayakumar
5 Replies

4. Shell Programming and Scripting

Request for help with SGE submission script manipulation

Hi, I have the following SGE submission (HPC calculation) script, which is just a Bash script: #!/bin/bash -l #$ -S /bin/bash #$ -l h_rt=1:00:0 #$ -l mem=4G #$ -N XXX #$ -pe qlc 24 #$ -P XXX #$ -wd /home/uccaxxx/Scratch/222PdT/3vac/c0001/ mpirun -m $TMPDIR/machines -np $NSLOTS... (2 Replies)
Discussion started by: crunchgargoyle
2 Replies

5. Shell Programming and Scripting

Request a script on manupilating the data. Please HELP!

Dear friends, I'm struggling to preparing a bunch of gaussian input files, say manually. It's really a time-consuming work without any techniques. I suppose that it could be done by a smart script automatically. But I lack some basic knowledge on scripting. Please help! My original input... (4 Replies)
Discussion started by: liuzhencc
4 Replies

6. Shell Programming and Scripting

Timing out lynx request in a bash script

I have a Bash script where, in a loop, I access several urls. Sometimes, if an url is not available, lynx hangs, and the script does not continue. How can I time out the lynx request when it takes more than, 10 Seconds, but continue with the other jobs... For some reason lynx does not care... (1 Reply)
Discussion started by: lowmaster
1 Replies

7. Shell Programming and Scripting

Solaris request script

Hi, In the request script I need to read user input and store to variable to use it later in postinstall script. e.g. LOGDIR=/app/log echo "Please type the Log Directory : (current value: $LOGDIR)" read LOGDIR When asked, if the user enters a value the parameter is ok and I... (2 Replies)
Discussion started by: potro
2 Replies

8. UNIX for Advanced & Expert Users

How to modify BASEDIR with request script?

Here is request script: #!/bin/sh echo "Current install root path is " CONFIRM="n" while do BASEDIR="" while true do echo please input install root path then press : read BASEDIR if then echo... (6 Replies)
Discussion started by: kingpmp
6 Replies

9. UNIX for Dummies Questions & Answers

unix script http request

Hi everybody, I have a *.vbs file which I want to run automatically. I want to know if there is anyway to implement the given example for e.g "http://255.255.255.55/script.vbs" what I mean is does anyone know how to make an http request from a unix script?? Thanks in advance!!!!!!!!!!! (1 Reply)
Discussion started by: arksal
1 Replies
Login or Register to Ask a Question