#!/bin/bash ########################################################################### # # # DO NOT CHANGE THIS FILE - IT WILL BE OVERWRITTEN !!! # # # ########################################################################### # NAME # start.admin - Start the PROGRESS AdminServer # # DESCRIPTION # Start AdminServer for AppServer and WebSpeed # # SYNTAX # start.admin [environment] # # AUTHOR # written by John Brink # # REVISION HISTORY # 0.1 02/16/2012 j6b - Initial Creation # 0.2 05/17/2012 j6b - Specify -port and -adminport # 0.3 10/08/2015 j6b - Use qclib.sh for general settings # 0.4 10/13/2015 j6b - Use 'default' naming convention # 0.5 10/21/2015 j6b - Adding comments from r3h (Ron Hunt) # 0.6 11/16/2015 j6b - Changing logfile permissions # 0.7 03/01/2016 j6b - Replace qclib.sh with LIB directory # 1.0 04/12/2016 j6b - Frozen v1.0 version # 1.1 05/25/2016 j6b - Add -adminport for multiple AdminServers # ------------------------------------------------------------------------ VERS=1.1 # 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 authorized to start the AdminServer" 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=$$)" #_cmd="${qcCMD} ${DLC}/bin/proadsv -port ${qcPORT} -adminport ${ADMINPORT} -start" logMsg INF "Starting AdminServer" _cmd="${qcCMD} ${DLC}/bin/proadsv -port ${qcPORT} -adminport ${qcADMINPORT} -start" eval ${_cmd} >> ${qcLOGFILE} 2>&1 logMsg INF "AdminServer started" # Execute customized code BEFORE starting databases if [[ -x ${qcCUST} ]] then logMsg INF "Customized code started" eval "${qcCMD} ${qcCUST} ${qcENV}" logMsg INF "Customized code ended" fi logMsg INF "Script ends." exit 0