4bff34e37def8a90f9194d81bc345c52ba20086athurlow#!/sbin/sh
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# CDDL HEADER START
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# The contents of this file are subject to the terms of the
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# Common Development and Distribution License (the "License").
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# You may not use this file except in compliance with the License.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# or http://www.opensolaris.org/os/licensing.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# See the License for the specific language governing permissions
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# and limitations under the License.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# When distributing Covered Code, include this CDDL HEADER in each
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# If applicable, add the following below this CDDL HEADER, with the
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# fields enclosed by brackets "[]" replaced with your own identifying
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# information: Portions Copyright [yyyy] [name of copyright owner]
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# CDDL HEADER END
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#
4bff34e37def8a90f9194d81bc345c52ba20086athurlow# Start/stop client SMB service
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow. /lib/svc/share/smf_include.sh
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Rossresult=${SMF_EXIT_OK}
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross
4bff34e37def8a90f9194d81bc345c52ba20086athurlowcase "$1" in
4bff34e37def8a90f9194d81bc345c52ba20086athurlow'start')
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross # Start the main smbiod service
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross /usr/lib/smbfs/smbiod-svc
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross result=$?
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross # Do smbfs mounts (background)
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross /usr/bin/ctrun -l none \
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross /sbin/mountall -F smbfs
4bff34e37def8a90f9194d81bc345c52ba20086athurlow ;;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow'stop')
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross # First destroy the mounts,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow /sbin/umountall -F smbfs
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross # then kill the smbiod service.
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross smf_kill_contract $2 TERM 1
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross result=$?
4bff34e37def8a90f9194d81bc345c52ba20086athurlow ;;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow*)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow echo "Usage: $0 { start | stop }"
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Ross result=1
4bff34e37def8a90f9194d81bc345c52ba20086athurlow ;;
4bff34e37def8a90f9194d81bc345c52ba20086athurlowesac
a547be5daca7e465ca82df6d179f6b1f8e0cda72Gordon Rossexit $result