8392N/A#!/bin/ksh
8392N/A#
8392N/A# Script for starting a postponed post-installation command in
8392N/A# a Live-Upgrade-safe environment
8392N/A#
8392N/A# CDDL HEADER START
8392N/A#
8392N/A# The contents of this file are subject to the terms of the
8392N/A# Common Development and Distribution License, Version 1.0 only
8392N/A# (the "License"). You may not use this file except in compliance
8392N/A# with the License.
8392N/A#
8392N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8392N/A# or http://www.opensolaris.org/os/licensing.
8392N/A# See the License for the specific language governing permissions
8392N/A# and limitations under the License.
8392N/A#
8392N/A# When distributing Covered Code, include this CDDL HEADER in each
8392N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
8392N/A# If applicable, add the following below this CDDL HEADER, with the
8392N/A# fields enclosed by brackets "[]" replaced with your own identifying
8392N/A# information: Portions Copyright [yyyy] [name of copyright owner]
8392N/A#
8392N/A# CDDL HEADER END
8392N/A#
8392N/A#
8392N/A# Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
8392N/A# Use is subject to license terms.
8392N/A#
8392N/A
8392N/Aexport PATH=/usr/bin
8392N/A
8392N/Apostrun_root_found=no
8392N/Aif [ "$PKG_INSTALL_ROOT" != "" ]; then
8392N/A pkginfo -q -R $PKG_INSTALL_ROOT SUNWpostrun-root && postrun_root_found=yes
8392N/Aelse
8392N/A pkginfo -q SUNWpostrun-root && postrun_root_found=yes
8392N/Afi
8392N/A
8392N/Aif [ $postrun_root_found = no ]; then
8392N/A echo 'WARNING: postrun could not find SUNWpostrun-root'
8392N/A echo ' You will need to execute the following commands as root'
8392N/A echo ' after installation:'
8392N/A echo '---- commands follow ----'
8392N/A cat
8392N/A echo '---- commands end ----'
8392N/A exit 0
8392N/Afi
8392N/A
8392N/Aif [ "$PKG_INSTALL_ROOT" != "" ]; then
8392N/A POSTRUN_ROOT_BASEDIR=`pkginfo -R $PKG_INSTALL_ROOT -l SUNWpostrun-root \
8392N/A | grep BASEDIR: | sed 's/BASEDIR:[ ]*//' | sed 's/ *//'`
8392N/Aelse
8392N/A POSTRUN_ROOT_BASEDIR=`pkginfo -l SUNWpostrun-root \
8392N/A | grep BASEDIR: | sed 's/BASEDIR:[ ]*//' | sed 's/ *//'`
8392N/Afi
8392N/A
8392N/Atest -x $PKG_INSTALL_ROOT$POSTRUN_ROOT_BASEDIR/var/lib/postrun/postrun || {
8392N/A echo "ERROR: SUNWpostrun-root is installed in $POSTRUN_ROOT_BASEDIR"
8392N/A echo " but $PKG_INSTALL_ROOT$POSTRUN_ROOT_BASEDIR/var/lib/postrun/postrun not found"
8392N/A exit 1
8392N/A}
8392N/A
8392N/Aexec $PKG_INSTALL_ROOT$POSTRUN_ROOT_BASEDIR/var/lib/postrun/postrun "${@}"