Home | History | Annotate | Download | only in sag
      1 #!/usr/bin/ksh
      2 #
      3 # CDDL HEADER START
      4 #
      5 # The contents of this file are subject to the terms of the
      6 # Common Development and Distribution License (the License).
      7 # You may not use this file except in compliance with the License.
      8 #
      9 # You can obtain a copy of the license at usr/src/CDDL.txt
     10 # or http://www.opensolaris.org/os/licensing.
     11 # See the License for the specific language governing permissions
     12 # and limitations under the License.
     13 #
     14 # When distributing Covered Code, include this CDDL HEADER in each
     15 # file and include the License file at usr/src/CDDL.txt.
     16 # If applicable, add the following below this CDDL HEADER, with the
     17 # fields enclosed by brackets [] replaced with your own identifying
     18 # information: Portions Copyright [yyyy] [name of copyright owner]
     19 #
     20 # CDDL HEADER END
     21 #
     22 
     23 #
     24 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     25 # Use is subject to license terms.
     26 #
     27 
     28 #ident	"@(#)stop_sag.ksh	1.5	07/08/07 SMI"
     29 
     30 # this is needed for backwards compatibility
     31 USE_SETTINGS_FILE=TRUE
     32 
     33 typeset opt
     34 
     35 while getopts 'R:G:U:D:Z' opt
     36 do
     37 	case "${opt}" in
     38 		R)      RESOURCE=${OPTARG};;
     39 		G)      RESOURCEGROUP=${OPTARG};;
     40 		U)	USE_SETTINGS_FILE=FALSE
     41 			User=${OPTARG};;
     42 		D)	USE_SETTINGS_FILE=FALSE
     43 			GATEWAY_DIR=${OPTARG};;
     44 		Z)      ;;		# kept for backwards compatibility
     45 		*)      exit 1;;
     46 	esac
     47 done
     48 
     49 . `dirname $0`/../etc/config
     50 . `dirname $0`/functions
     51 
     52 validate_options
     53 
     54 debug_message "Method: `basename $0` - Begin"
     55 $SET_DEBUG
     56 
     57 for file in ${GATEWAY_DIR}/bin/sag_env.ksh ${GATEWAY_DIR}/bin/sag_bootstrap
     58 do
     59   validate ${file}
     60 
     61   if [ "$rc_validate" -ne 0 ]
     62   then
     63         debug_message "Method: `basename $0` - End (Exit 1)"
     64         exit 1
     65   fi
     66 done
     67 
     68 stop_sag
     69 
     70 if [ "$rc_stop_command" -eq 0 ]
     71 then
     72         log_message notice "stop_sag succeeded : rc<$rc_stop_command>"
     73         debug_message "Method: `basename $0` - End (Exit 0)"
     74         exit 0
     75 else
     76         log_message err "stop_sag failed : rc<$rc_stop_command>"
     77 	debug_message "Method: `basename $0` - End (Exit $rc_stop_command)"
     78 	exit $rc_stop_command
     79 fi
     80