#
#
# 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
#
#
#
# Retrieve an unescaped property value from a method token.
# Arguments:
# - raw method token value
# Outputs:
# - unescaped property value
# Returns:
# - 0 on succes
# - 1 when unescaping failed
# - 2 when the value is empty
function get_property
{
if [[ $? -ne 0 ]]; then
exit 1
fi
echo "$VALUE"
}
function failure
{
echo "missing or system resources are exhausted."
exit $SMF_EXIT_ERR_FATAL
}
# store and unescape property values
if [[ -z $PFLOGD_LOGFILE ]]; then
exit $SMF_EXIT_ERR_FATAL
fi
if [[ -z $PFLOGD_SNAPLEN ]]; then
exit $SMF_EXIT_ERR_FATAL
fi
if [[ -z $PFLOGD_IFACE ]]; then
exit $SMF_EXIT_ERR_FATAL
fi
if [[ -z $PFLOGD_DELAY ]]; then
exit $SMF_EXIT_ERR_FATAL
fi
case "$1" in
# Create non-persistent capture link if it does not exist.
echo "Checking if capture link exists.."
if [[ $? -ne 0 ]] ; then
echo "Creating a temporary capture link.."
if [ $? -ne 0 ] ; then
exit $SMF_EXIT_ERR_FATAL
fi
fi
# Start the daemon.
-f "$PFLOGD_LOGFILE" -d "$PFLOGD_DELAY" "$PFLOGD_FILTER"
if [[ $? -ne 0 ]] ; then
exit $SMF_EXIT_ERR_FATAL
fi
;;
*)
echo "Usage: $0 \c" >&2
echo "(start)" >&2
exit 1
;;
esac
exit $SMF_EXIT_OK