#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# This is the audio_clean program.
#
# Following is the syntax for calling the script:
# scriptname [-s|-f|-i|-I] devicename [-A|-D] [username] [zonename]
# [zonepath]
#
# $1: -s for standard cleanup by a user
# -f for forced cleanup by an administrator
# -i for boot-time initialization (when the system is booted with -r)
# mode
#
# $2: devicename - device to be allocated/deallocated, e.g., sr0
#
# $3: -A if cleanup is for allocation, or -D if cleanup is for deallocation.
#
# $4: username - run the script as this user, rather than as the caller.
#
# $5: zonename - zone in which device to be allocated/deallocated
#
# $6: zonepath - root path of zonename
#
# Unless the clean script is being called for boot-time
# initialization, it may communicate with the user via stdin and
# stdout. To communicate with the user via CDE dialogs, create a
# script or link with the same name, but with ".windowing" appended.
# For example, if the clean script specified in device_allocate is
# script named /etc/security/xyz_clean.windowing exists, it must use
# dialogs. To present dialogs to the user, the dtksh script
#
# using dialogs. A symbolic link audio_clean.windowing points to
# audio_clean.
USAGE="usage: $0 [-s|-f|-i|-I] devicename [-A|-D][username][zonename][zonepath]"
MODE="allocate"
WINDOWING="yes"
else
WINDOWING="no"
fi
#
# *** Shell Function Declarations ***
#
TITLE="Audio Device Allocation"
else
TITLE="Audio Device Dellocation"
fi
else
echo "$*"
fi
}
else
fi
exit 1
}
#
# Main program
#
# Check syntax, parse arguments.
while getopts ifsI c
do
case $c in
i)
FLAG=$c;;
f)
FLAG=$c;;
s)
FLAG=$c;;
I)
FLAG=i
silent=y;;
exit 1;;
esac
done
DEVICE=$1
if [ "$2" = "-A" ]; then
MODE="allocate"
elif [ "$2" = "-D" ]; then
MODE="deallocate"
fi
exit 1
fi
ZONENAME=$4
ZONEPATH=$5
if [ ! -d ${SAVEDIR} ]
then
fi
do
DEVNM=$d
break
fi
done
if [ "${FLAG}" = "i" -a ! -r "${SAVEFILE}" ]
then
else
fi
exit 0