The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Request to modify script to list multiple parameters for V_fieldid variable Sammy Shell Programming and Scripting 0 03-30-2008 09:08 PM
unix script http request arksal UNIX for Dummies Questions & Answers 1 08-24-2006 11:15 PM
a request for help... patrick99e99 UNIX for Advanced & Expert Users 1 07-25-2006 03:50 AM
request born script for creting backup files vinaysamineni Shell Programming and Scripting 6 09-15-2005 01:46 PM
Request sed help anjaan UNIX for Dummies Questions & Answers 2 03-08-2005 07:13 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-01-2008
Tornado's Avatar
Tornado Tornado is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Location: Melbourne
Posts: 249
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.
  #2 (permalink)  
Old 04-01-2008
unilover unilover is offline
Registered User
  
 

Join Date: Mar 2008
Location: Toronto, Canada
Posts: 66
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 (permalink)  
Old 04-01-2008
Tornado's Avatar
Tornado Tornado is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Location: Melbourne
Posts: 249
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.
  #4 (permalink)  
Old 04-01-2008
reborg's Avatar
reborg reborg is online now Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,211
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 (permalink)  
Old 04-01-2008
Tornado's Avatar
Tornado Tornado is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Location: Melbourne
Posts: 249
You are spot on.. Adding LOGHOSTSRVR to pkginfo has fixed my issue

Thanks for that.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0