4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# CDDL HEADER START
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# The contents of this file are subject to the terms of the
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# Common Development and Distribution License (the "License").
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# You may not use this file except in compliance with the License.
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# See the License for the specific language governing permissions
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# and limitations under the License.
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# When distributing Covered Code, include this CDDL HEADER in each
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# If applicable, add the following below this CDDL HEADER, with the
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# fields enclosed by brackets "[]" replaced with your own identifying
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# information: Portions Copyright [yyyy] [name of copyright owner]
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# CDDL HEADER END
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# Use is subject to license terms.
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs# ident "%Z%%M% %I% %E% SMI"
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsMESSAGE_PREFIX="org.freedesktop.Hal.Device.NetworkDiscovery"
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsOBJECT_PATH="/org/freedesktop/Hal/devices/network_attached"
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs interval=`/bin/svcprop -p config/interval ${SMF_FMRI} 2>/dev/null`
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs community=`/bin/svcprop -p config/community ${SMF_FMRI} 2>/dev/null`
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs network=`/bin/svcprop -p config/network ${SMF_FMRI} 2>/dev/null`
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs MESSAGE="${MESSAGE_PREFIX}.EnablePrinterScanningViaSNMP"
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs --dest=${DBUS_DESTINATION} --type=method_call ${OBJECT_PATH} \
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs MESSAGE="${MESSAGE_PREFIX}.DisablePrinterScanningViaSNMP"
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs --dest=${DBUS_DESTINATION} --type=method_call ${OBJECT_PATH} \
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs community=`/bin/svcprop -p config/community ${SMF_FMRI} 2>/dev/null`
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs network=`/bin/svcprop -p config/network ${SMF_FMRI} 2>/dev/null`
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs MESSAGE="${MESSAGE_PREFIX}.EnablePrinterScanningViaSNMP"
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs --dest=${DBUS_DESTINATION} --type=method_call ${OBJECT_PATH} \
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs count=`$SVCS -o STATE hal 2>>/dev/null | grep -c "^online"`
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs exit 0 # if HAL isn't running, there is nothing to do