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

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Question on install software package on Linux cy163 UNIX for Dummies Questions & Answers 1 06-09-2008 05:03 AM
looking for ImageMagick install package mickeymouse UNIX and Linux Applications 2 05-30-2008 09:30 AM
install and uninstall package anhtt SUN Solaris 1 05-10-2008 04:20 AM
how to install package amitarcade SUN Solaris 2 01-23-2008 05:56 PM
uninstall and install a package big123456 UNIX for Dummies Questions & Answers 6 01-19-2007 10:54 AM

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 08-08-2008
kingpmp kingpmp is offline
Registered User
  
 

Join Date: Aug 2008
Location: Sydney - Australia
Posts: 8
Question Package post-install script problem

I wrote a post-install script, which is executed after the package installation by command like " pkgadd -d /mypackage.pkg".

I also want to read user input in post-install script as follows:
Code:
  while [ "$ANSWER" != "y" -a "$ANSWER" != "n" ] ;
  do
     echo "Apply changes to database? [y/n]:"
     read ANSWER
  done
However, it does NOT pause and wait for user input at all! Instead, it goes into an infinite loop:
Code:
Apply changes to database? [y/n]:
Apply changes to database? [y/n]:
Apply changes to database? [y/n]:
Apply changes to database? [y/n]:
Apply changes to database? [y/n]:
...
Any advice will be appreciated!
  #2 (permalink)  
Old 08-08-2008
kingpmp kingpmp is offline
Registered User
  
 

Join Date: Aug 2008
Location: Sydney - Australia
Posts: 8
By the way, if I run the script separately, everything is fine!
  #3 (permalink)  
Old 08-08-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
I'm not familiar with pkgadd but it looks like it's running the script with input redirected from /dev/null. The recommendation for package installation scripts is to avoid user interaction, anyway. I'd suggest you avoid this dialog altogether; if it's absolutely necessary, I'm imagining the pkgadd documentation will have suggestions for how to properly engage the administrator in a dialogue (probably even before this script runs).
  #4 (permalink)  
Old 08-10-2008
kingpmp kingpmp is offline
Registered User
  
 

Join Date: Aug 2008
Location: Sydney - Australia
Posts: 8
Thanks era.

I went through pkgadd and pkgmk documentation and got no answer for this, unfortunately!

After disucssion with my colleague, we came up with an idea - read the user input from a jar then return to shell script.

It works!
  #5 (permalink)  
Old 08-11-2008
kingpmp kingpmp is offline
Registered User
  
 

Join Date: Aug 2008
Location: Sydney - Australia
Posts: 8
My mistake! It still doesn't work!

According to Solaris packaging documentation, the only place, which the installer can solicit user input, is through "request script". That's a stage far before post-install.
  #6 (permalink)  
Old 08-11-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Yes, you just need to pass the result to the post-install script somehow.
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 10:42 PM.


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