components/privoxy/files/http-privoxy
author Rich Burridge <rich.burridge@oracle.com>
Tue, 02 May 2017 17:33:26 -0700
changeset 7964 d9801318ed3d
parent 407 371955ee7fe6
permissions -rw-r--r--
25981468 Build ilmbase and openexr with the GNU compilers
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
407
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     1
#!/usr/bin/ksh93
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     2
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     3
#
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     4
# CDDL HEADER START
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     5
#
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     6
# The contents of this file are subject to the terms of the
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     7
# Common Development and Distribution License (the "License").
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     8
# You may not use this file except in compliance with the License.
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     9
#
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    10
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    11
# or http://www.opensolaris.org/os/licensing.
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    12
# See the License for the specific language governing permissions
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    13
# and limitations under the License.
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    14
#
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    15
# When distributing Covered Code, include this CDDL HEADER in each
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    16
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    17
# If applicable, add the following below this CDDL HEADER, with the
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    18
# fields enclosed by brackets "[]" replaced with your own identifying
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    19
# information: Portions Copyright [yyyy] [name of copyright owner]
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    20
#
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    21
# CDDL HEADER END
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    22
#
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    23
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    24
#
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    25
# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    26
# Use is subject to license terms.
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    27
#
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    28
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    29
source /lib/svc/share/smf_include.sh
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    30
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    31
typeset -r PRIVOXY_PRG=privoxy
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    32
typeset -r PRIVOXY=/usr/lib/privoxy
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    33
typeset -r PIDFILE=/var/log/privoxy/privoxy.pid
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    34
typeset -r CONF_FILE=/etc/privoxy/config
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    35
typeset -r PRIVOXY_USER=webservd
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    36
typeset -r PRIVOXY_GROUP=webservd
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    37
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    38
[[ ! -f ${CONF_FILE} ]] && exit $SMF_EXIT_ERR_CONFIG
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    39
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    40
case "$1" in
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    41
start)
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    42
        /bin/rm -f ${PIDFILE}
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    43
        exec ${PRIVOXY} --pidfile "${PIDFILE}" \
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    44
            --user "${PRIVOXY_USER}.${PRIVOXY_GROUP}" "$CONF_FILE" 2>&1
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    45
        ;;
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    46
*)
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    47
        print "Invalid method $1"
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    48
        exit 1
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    49
        ;;
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    50
esac
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    51
371955ee7fe6 7067109 Move privoxy to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    52
# not reached