components/gutenprint/gutenprint.startup
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Wed, 29 Aug 2012 11:05:56 -0700
changeset 957 255465c5756f
parent 853 72b657a4e294
permissions -rw-r--r--
Close of build 04.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
810
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     1
#!/usr/bin/sh
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     2
#
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     3
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     4
#
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     5
# This script should be run from the CUPS scheduler service start method.
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     6
#
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     7
# usage: /usr/lib/cups/startup/gutenprint <fmri> <pg/prop>
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     8
#
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     9
# where: <fmri>    ... FMRI of the CUPS scheduler service
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    10
#        <pg/prop> ... property group/name where to store status
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    11
#
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    12
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    13
SVC=$1
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    14
PROP=$2
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    15
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    16
# verify input arguments
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    17
if [ -z "$SVC" -o -z "$PROP" ] ; then
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    18
	echo "$0: Invalid arguments."
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    19
	echo "usage: $0 <fmri> <pg/prop>"
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    20
	exit 1
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    21
fi
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    22
853
72b657a4e294 7173189 application/cups/scheduler:default start fails to maintenance, Start method died on Killed
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents: 810
diff changeset
    23
# package name
72b657a4e294 7173189 application/cups/scheduler:default start fails to maintenance, Start method died on Killed
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents: 810
diff changeset
    24
PKG="pkg:/print/filter/gutenprint"
72b657a4e294 7173189 application/cups/scheduler:default start fails to maintenance, Start method died on Killed
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents: 810
diff changeset
    25
810
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    26
# determine the package version
853
72b657a4e294 7173189 application/cups/scheduler:default start fails to maintenance, Start method died on Killed
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents: 810
diff changeset
    27
VER=`pkg contents -H -a name=pkg.fmri -o value $PKG | cut -d @ -f 2`
810
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    28
if [ -z "$VER" ] ; then
853
72b657a4e294 7173189 application/cups/scheduler:default start fails to maintenance, Start method died on Killed
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents: 810
diff changeset
    29
	echo "$0: Failed to read $PKG package version."
810
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    30
	exit 1
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    31
fi
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    32
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    33
# read the value of status property, if it exists
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    34
if svcprop -q -p "$PROP" "$SVC" ; then
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    35
	VAL=`svcprop -p "$PROP" "$SVC"`
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    36
fi
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    37
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    38
# compare the value with package version
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    39
if [ "$VAL" = "$VER" ] ; then
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    40
	# PPD files already updated for this package version
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    41
	exit 0
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    42
fi
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    43
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    44
# update PPD files
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    45
if ! /usr/sbin/cups-genppdupdate ; then
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    46
	echo "$0: Failed to update PPD files."
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    47
	exit 1
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    48
fi
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    49
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    50
# store status into the SMF repository
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    51
svccfg -s "$SVC" setprop "$PROP" = astring: "$VER"
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    52
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    53
exit 0