1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove#!/usr/bin/ksh93
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove#
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# CDDL HEADER START
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove#
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# The contents of this file are subject to the terms of the
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# Common Development and Distribution License (the "License").
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# You may not use this file except in compliance with the License.
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove#
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# or http://www.opensolaris.org/os/licensing.
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# See the License for the specific language governing permissions
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# and limitations under the License.
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove#
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# When distributing Covered Code, include this CDDL HEADER in each
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# If applicable, add the following below this CDDL HEADER, with the
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# fields enclosed by brackets "[]" replaced with your own identifying
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# information: Portions Copyright [yyyy] [name of copyright owner]
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove#
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# CDDL HEADER END
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove#
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove#
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove# Use is subject to license terms.
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove#
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grovesource /lib/svc/share/smf_include.sh
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grove
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grovetypeset -r PRIVOXY_PRG=privoxy
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grovetypeset -r PRIVOXY=/usr/lib/privoxy
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grovetypeset -r PIDFILE=/var/log/privoxy/privoxy.pid
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grovetypeset -r CONF_FILE=/etc/privoxy/config
1f439f8b8b07b0c6764ee0cb0114d54246c44d67Ryan Grovetypeset -r PRIVOXY_USER=webservd
typeset -r PRIVOXY_GROUP=webservd
[[ ! -f ${CONF_FILE} ]] && exit $SMF_EXIT_ERR_CONFIG
case "$1" in
start)
/bin/rm -f ${PIDFILE}
exec ${PRIVOXY} --pidfile "${PIDFILE}" \
--user "${PRIVOXY_USER}.${PRIVOXY_GROUP}" "$CONF_FILE" 2>&1
;;
*)
print "Invalid method $1"
exit 1
;;
esac
# not reached