#!/bin/bash ########################################################################### # # # DO NOT CHANGE THIS FILE - IT WILL BE OVERWRITTEN !!! # # # ########################################################################### # NAME # stop.admin - Stop the PROGRESS AdminServer # # DESCRIPTION # Stop the Progress AdminServer # # SYNTAX # stop.admin [environment] # # AUTHOR # written by David Cohen # # REVISION HISTORY # 0.1 01/01/2010 ddc - Initial Creation # 0.2 02/16/2012 j6b - Add header information and made general # 0.3 05/17/2012 j6b - Specify -port # 0.4 10/09/2015 j6b - Use qclib.sh for general settings # 0.5 10/13/2015 j6b - Use 'default' naming convention # 0.6 10/21/2015 j6b - Adding comments from r3h (Ron Hunt) # 0.7 11/16/2015 j6b - Change logfile permissions # 0.8 03/01/2016 j6b - Replace qclib.sh with LIB directory # 1.0 04/12/2016 j6b - Frozen v1.0 version # ------------------------------------------------------------------------- # vim:ts=4 VERS=1.0 # Version of this script. ##----------------## ## Load Libraries ## ##----------------## _me=${0} _libdir=$(dirname ${_me})/lib typeset -i _libcount=0 if [[ -d ${_libdir} ]] then # Load standard libraries for i in $(ls ${_libdir}/*std.LIB 2> /dev/null) do source ${i} _libcount=$((_libcount + 1)) done # Load customized libraries - if applicable for i in $(ls ${_libdir}/*cst.LIB 2> /dev/null) do source ${i} done else echo "Library ${_libdir} not found" exit 99 fi if [[ ${_libcount} = 0 ]] then echo "No libraries loaded from ${LIB}" exit 99 fi if [[ "${1}" == "-h" ]] || [[ "${1}" == "--help" ]] then dispHelp; exit 0 fi ##----------------## ## M A I N ## ##----------------## getEnv ${1} checkUser errorHandler ${?} ERR "This user is not allowed to stop the environment" if [[ -f ${qcLOGFILE} ]] then _cmd="${qcCMD} /bin/mv -f ${qcLOGFILE} ${qcLOGFILE}.$(date '+%d')" eval ${_cmd} fi # Create logfile with right permissions _cmd="${qcCMD} touch ${qcLOGFILE}" eval ${_cmd} logMsg INF "Script starts. (v=${VERS}) (PID=$$)" # Execute customized code BEFORE stopping AdminServer if [[ -x ${qcCUST} ]] then logMsg INF "Customized code started" eval "${qcCMD} ${qcCUST} ${qcENV}" logMsg INF "Customized code ended" fi #_cmd="${qcCMD} ${DLC}/bin/proadsv -port ${qcPORT} -adminport ${ADMINPORT} -stop" logMsg INF "Stopping AdminServer" _cmd="${qcCMD} ${DLC}/bin/proadsv -port ${qcPORT} -stop" eval ${_cmd} >> ${qcLOGFILE} 2>&1 logMsg INF "AdminServer stopped" logMsg INF "Script ends." exit 0