preinstall revision c81d47afd05baeb768e2f032636019b717899efd
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# CDDL HEADER START
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# The contents of this file are subject to the terms of the
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# Common Development and Distribution License (the "License").
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# You may not use this file except in compliance with the License.
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# See the License for the specific language governing permissions
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# and limitations under the License.
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# When distributing Covered Code, include this CDDL HEADER in each
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# If applicable, add the following below this CDDL HEADER, with the
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# fields enclosed by brackets "[]" replaced with your own identifying
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# information: Portions Copyright [yyyy] [name of copyright owner]
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# CDDL HEADER END
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp# Use is subject to license terms.
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp#ident "%Z%%M% %I% %E% SMI"
7888277d51428db45a0221d0ca9626c04d31a06fJeff Conniffif [ "$UPDATE" = "yes" ]; then
7888277d51428db45a0221d0ca9626c04d31a06fJeff Conniff BASEPREFIX=`echo $BASEDIR | sed "s/\//_/g"`
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp MANIFESTDIR="$BASEDIR/var/svc/manifest/application/print"
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp LPFILENAME=`echo sunwpsr_lpsched"$BASEPREFIX" | cut -c 1-256`
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp PPDFILENAME=`echo sunwpsr_ppd_cache_update"$BASEPREFIX" | cut -c 1-256`
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp LPTMPFILE=/tmp/$LPFILENAME
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp PPDTMPFILE=/tmp/$PPDFILENAME
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp if [ -f $LPTMPFILE ] ; then
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp rm $LPTMPFILE
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp if [ -f $PPDTMPFILE ] ; then
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp rm $PPDTMPFILE
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp # If we are upgrading a system with smf(5) already installed, then we
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp # won't take any action. Otherwise, if there are local print queues,
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp # the service was enabled, preserve that.
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp if [ ! -f $MANIFESTDIR/server.xml ]; then
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp queues=`echo $BASEDIR/etc/lp/printers/*/configuration`
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp if [ "$queues" != "$BASEDIR/etc/lp/printers/*/configuration" ];
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp touch $LPTMPFILE
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp # If we are upgrading a system with ppd-cache-update service already
7888277d51428db45a0221d0ca9626c04d31a06fJeff Conniff # installed, then don't take any action in postinstall script.
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp if [ ! -f $MANIFESTDIR/ppd-cache-update.xml ] ; then
dd68f827968d5a55f4656a413c8af8b1c032d08fTripp touch $PPDTMPFILE