svc-avahi-bridge-dsd revision 5255
246N/A#!/sbin/sh
246N/A#
246N/A# CDDL HEADER START
281N/A#
281N/A# The contents of this file are subject to the terms of the
246N/A# Common Development and Distribution License (the "License").
131N/A# You may not use this file except in compliance with the License.
131N/A#
131N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
131N/A# or http://www.opensolaris.org/os/licensing.
131N/A# See the License for the specific language governing permissions
131N/A# and limitations under the License.
131N/A#
131N/A# When distributing Covered Code, include this CDDL HEADER in each
131N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
131N/A# If applicable, add the following below this CDDL HEADER, with the
131N/A# fields enclosed by brackets "[]" replaced with your own identifying
131N/A# information: Portions Copyright [yyyy] [name of copyright owner]
131N/A#
131N/A# CDDL HEADER END
131N/A#
131N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
131N/A# Use is subject to license terms.
131N/A#
131N/A# ident "@(#)svc-avahi-bridge-dsd 1.1 06/04/24 SMI"
144N/A
131N/AFMRI=svc:/system/avahi-bridge-dsd:default
131N/A
246N/A. /lib/svc/share/smf_include.sh
131N/A
131N/Aif [ ! -x /usr/sbin/avahi-daemon-bridge-dsd ]; then
183N/A echo "/usr/sbin/avahi-daemon-bridge-dsd not found or not executable"
183N/A exit $SMF_EXIT_ERR_FATAL
131N/Afi
131N/A
131N/Aif smf_is_nonglobalzone; then
131N/A /usr/sbin/svcadm disable -t svc:/system/avahi-bridge-dsd
131N/A echo "avahi-bridge-dsd cannot be run in non-global zones"
340N/A sleep 5 &
340N/A exit $SMF_EXIT_OK
131N/Afi
131N/A
131N/Acase "$1" in
246N/A'start')
131N/A /usr/sbin/avahi-daemon-bridge-dsd -D
131N/A err=$?
183N/A if [ $err -ne 0 ]; then
183N/A echo "avahi-daemon-bridge-dsd failed to start: error $err"
131N/A exit $SMF_EXIT_ERR_FATAL
131N/A fi
131N/A ;;
131N/A'stop')
340N/A /usr/sbin/avahi-daemon-bridge-dsd -k
340N/A ;;
340N/A*)
340N/A echo "Usage: $0 { start }"
131N/A exit $SMF_EXIT_ERR_FATAL
131N/A ;;
131N/Aesac
131N/A
131N/Aexit $SMF_EXIT_OK
131N/A