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