components/squid/files/http-squid
branchs11u1-sru
changeset 2630 1bd7ef7e23a1
parent 163 492ba3a66c6f
equal deleted inserted replaced
2625:5dad0fc5ed82 2630:1bd7ef7e23a1
       
     1 #!/usr/bin/ksh93
       
     2 
       
     3 #
       
     4 # CDDL HEADER START
       
     5 #
       
     6 # The contents of this file are subject to the terms of the
       
     7 # Common Development and Distribution License (the "License").
       
     8 # You may not use this file except in compliance with the License.
       
     9 #
       
    10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
    11 # or http://www.opensolaris.org/os/licensing.
       
    12 # See the License for the specific language governing permissions
       
    13 # and limitations under the License.
       
    14 #
       
    15 # When distributing Covered Code, include this CDDL HEADER in each
       
    16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    17 # If applicable, add the following below this CDDL HEADER, with the
       
    18 # fields enclosed by brackets "[]" replaced with your own identifying
       
    19 # information: Portions Copyright [yyyy] [name of copyright owner]
       
    20 #
       
    21 # CDDL HEADER END
       
    22 #
       
    23 # Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
       
    24 #
       
    25 
       
    26 source /lib/svc/share/smf_include.sh
       
    27 
       
    28 typeset -r SQUID_HOME=/usr/squid
       
    29 typeset -r CONF_FILE=/etc/squid/squid.conf
       
    30 typeset -r PIDFILE=/var/squid/logs/squid.pid
       
    31 typeset -r SQUID="${SQUID_HOME}/sbin/squid"
       
    32 
       
    33 [[ ! -f ${CONF_FILE} ]] && exit $SMF_EXIT_ERR_CONFIG
       
    34 
       
    35 
       
    36 case "$1" in
       
    37 start)
       
    38         /bin/rm -f ${PIDFILE}
       
    39         if [[ ! -d /var/squid/cache/00 ]] ; then
       
    40                 out="$(${SQUID} -z)"
       
    41         fi
       
    42 
       
    43         exec ${SQUID} 2>&1
       
    44         ;;
       
    45 stop)
       
    46         exec ${SQUID} -k shutdown 2>&1
       
    47         ;;
       
    48 *)
       
    49         print "Usage: $0 {start|stop}"
       
    50         exit 1
       
    51         ;;
       
    52 esac
       
    53 
       
    54 # not reached