components/cups/Solaris/print-service-selector
changeset 481 9ca5b97b5b08
parent 480 e031a1a0c3a1
child 482 be3d0ad01572
--- a/components/cups/Solaris/print-service-selector	Thu Aug 18 21:38:10 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-#!/bin/ksh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
-#
-
-. /lib/svc/share/smf_include.sh
-
-CUPS_SVC='cups/scheduler'
-CUPS_BIN='/usr/lib/cups/bin/lp'
-LP_BIN='/usr/lib/lp/bin/lp'
-ACTIVE_SVC_PROP='general/active'
-
-is_cups_active()
-{
-    ACTIVE=$( /usr/bin/svcprop -C -p "$ACTIVE_SVC_PROP" "${CUPS_SVC}:default" \
-            2>/dev/null )
-    [[ "$ACTIVE" == 'true' ]]
-}
-
-is_lp_installed()
-{
-    [[ -f "$LP_BIN" ]]
-}
-
-is_cups_installed()
-{
-    [[ -f "$CUPS_BIN" ]]
-}
-
-set_cups_active()
-{
-    if ! /usr/sbin/print-service -s cups
-    then
-        echo "ERROR: Unable to set CUPS as the default print service" >&2
-        exit $SMF_EXIT_ERR_FATAL
-    fi
-}
-
-if is_lp_installed
-then
-    # Do nothing.  They either upgraded, installed LP only, or both.
-    # In any of these cases, we either want the default or the previously
-    # selected behaviour.
-    true
-elif is_cups_installed
-then
-    # LP is not installed -- make CUPS the default if it is not already
-    is_cups_active || set_cups_active
-else
-    echo "ERROR: Neither CUPS nor LP packages installed" >&2
-	exit $SMF_EXIT_ERR_FATAL
-fi
-
-exit $SMF_EXIT_OK