docbook-catalog-update.sh revision 17950
12258N/A#!/bin/ksh -p
12258N/A#
12258N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
12412N/A# Use is subject to license terms.
12258N/A#
12258N/A# Permission is hereby granted, free of charge, to any person obtaining a
12258N/A# copy of this software and associated documentation files (the
17185N/A# "Software"), to deal in the Software without restriction, including
12258N/A# without limitation the rights to use, copy, modify, merge, publish,
12258N/A# distribute, and/or sell copies of the Software, and to permit persons
17176N/A# to whom the Software is furnished to do so, provided that the above
17176N/A# copyright notice(s) and this permission notice appear in all copies of
15153N/A# the Software and that both the above copyright notice(s) and this
12258N/A# permission notice appear in supporting documentation.
15293N/A#
12258N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16572N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17432N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
12258N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
12258N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
12258N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
12258N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
12258N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
16214N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15153N/A#
15153N/A# Except as contained in this notice, the name of a copyright holder
12258N/A# shall not be used in advertising or otherwise to promote the sale, use
16130N/A# or other dealings in this Software without prior written authorization
12517N/A# of the copyright holder.
16130N/A#
15234N/A###########################################################################
16130N/A#
14295N/A
16130N/APATH=/usr/bin:/usr/sbin
15260N/A
16130N/A. /lib/svc/share/smf_include.sh
16130N/A
16130N/AUSAGE="Usage: $0 { start | refresh }"
16130N/A
16130N/Aif [ $# -ne 1 ] ; then
16299N/A echo $USAGE
16299N/A exit 2
17380N/Afi
17380N/A
17700N/ACATALOG_INSTALL=/usr/share/sgml/docbook/docbook-catalog-install.sh
17700N/ACATALOG_UNINSTALL=/usr/share/sgml/docbook/docbook-catalog-uninstall.sh
17700N/A
17380N/Astart_docbook_catalog_update ()
12258N/A{
12258N/A if [ ! -f /etc/xml/catalog -o $CATALOG_INSTALL -nt /etc/xml/catalog ]; then
12258N/A $CATALOG_INSTALL
12258N/A fi
12258N/A}
12258N/A
12258N/Arefresh_docbook_catalog_update ()
12258N/A{
12258N/A if [ ! -f /etc/xml/catalog -o $CATALOG_INSTALL -nt /etc/xml/catalog ]; then
12258N/A $CATALOG_UNINSTALL > /dev/null 2>&1
12258N/A $CATALOG_INSTALL
12258N/A fi
12258N/A}
12258N/A
12258N/AMETHOD=$1
12258N/A
12258N/Acase "$METHOD" in
12258N/A 'start')
12258N/A # Continue with rest of script
12258N/A ;;
12258N/A 'refresh')
12258N/A # Continue with rest of script
12258N/A ;;
12258N/A -*)
12258N/A echo $USAGE
12258N/A exit 2
12258N/A ;;
12258N/A *)
12258N/A echo "Invalid method $METHOD"
12258N/A exit 2
12258N/A ;;
12258N/Aesac
12258N/A
12258N/A${METHOD}_docbook_catalog_update
12258N/A
12258N/Aexit $SMF_EXIT_OK
12258N/A