3 # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
5 # This script should be run from the CUPS scheduler service start method.
7 # usage: /usr/lib/cups/startup/gutenprint <fmri> <pg/prop>
9 # where: <fmri> ... FMRI of the CUPS scheduler service
10 # <pg/prop> ... property group/name where to store status
16 # verify input arguments
17 if [ -z "$SVC" -o -z "$PROP" ] ; then
18 echo "$0: Invalid arguments."
19 echo "usage: $0 <fmri> <pg/prop>"
24 PKG
="pkg:/print/filter/gutenprint"
26 # determine the package version
27 VER
=`pkg contents -H -a name=pkg.fmri -o value $PKG | cut -d @ -f 2`
28 if [ -z "$VER" ] ; then
29 echo "$0: Failed to read $PKG package version."
33 # read the value of status property, if it exists
34 if svcprop
-q -p "$PROP" "$SVC" ; then
35 VAL
=`svcprop -p "$PROP" "$SVC"`
38 # compare the value with package version
39 if [ "$VAL" = "$VER" ] ; then
40 # PPD files already updated for this package version
45 if ! /usr
/sbin
/cups-genppdupdate
; then
46 echo "$0: Failed to update PPD files."
50 # store status into the SMF repository
51 svccfg
-s "$SVC" setprop
"$PROP" = astring
: "$VER"