postremove question



I have a very quick pkg question.

I want to query the user after a pkg has been removed whether or not to
execute a certain command. I created a postremove file:

---------
echo ""
echo "foobar pkg removed. Remove it from the manifest? (y/[n]) \c"
read ans
if [ "x${ans}x" = "xyx" ]; then
echo "Now disabling foobar \c"
/usr/sbin/svcadm disable site/foobar
echo "and removing it."
/usr/sbin/svccfg delete -f site/foobar
else
echo "Nothing done. The service is still running, although the underlying"
echo "binary no longer exists."
fi
--------

The script runs after a pkgrm, but it does not wait for user input. How
do I get pkgrm to query the user for a y/n?

+-----------------------------------------------------------------------+
| Christopher L. Barnard O When I was a boy I was told that |
| cbarnard@xxxxxxxxxxxx / \ anybody could become president. |
| (312) 347-4901 O---O Now I'm beginning to believe it. |
| http://www.cs.uchicago.edu/~cbarnard --Clarence Darrow |
+----------PGP public key available via finger or PGP keyserver---------+
_______________________________________________
sunmanagers mailing list
sunmanagers@xxxxxxxxxxxxxxx
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



Relevant Pages

  • Re: Running Update Macro disables switchboard
    ... Turning the echo back on at the end of the script returned the same result. ... The reports have products & pricing and are sent out monthly - about a week ... Regular prices don't change that often, but sale prices go on and off. ... I delete the old query as the new one will ask for a different 'sale price' ...
    (microsoft.public.access.macros)
  • Re: Tough Analytical SQL Question
    ... for each ctype and order_date, ... CTYPE = 'ECHO' ... (PARTITION BY ctype_id ORDER BY order_date RANGE 7 PRECEDING) ... The results of the inner query starting with "SELECT DISTINCT ...
    (comp.databases.oracle.server)
  • Re: Tough Analytical SQL Question
    ... for each ctype and order_date, ... CTYPE = 'ECHO' ... (PARTITION BY ctype_id ORDER BY order_date RANGE 7 PRECEDING) ... The results of the inner query starting with "SELECT DISTINCT ...
    (comp.databases.oracle.server)
  • PDO: Debugging prepared statements
    ... function that also provided some debugging support to echo the query ... Being able to echo back SQL statements as they are being ... Prepared Statements don't work the way doing queries the traditional ... I can't echo the query being ...
    (comp.lang.php)
  • Re: [PHP] File uploading and saving info on mysql
    ... I'm developing for my first time an upload file form which will populate a sql insert query, I think I got everything working fine, but the data isn't been saved on the database. ... This way I can echo it out and see it before it get executed. ...
    (php.general)