#!/bin/bash #============================================================================== # Copyright and license info is available in the LICENSE file included with # the Server Deployment Package (SDP), and also available online: # https://swarm.workshop.perforce.com/projects/perforce-software-sdp/view/main/LICENSE #------------------------------------------------------------------------------ # # Use "chkconfig --add p4broker_REPL_SDP_INSTANCE_init" to set up the script to start and stop automatically. # Perforce Init Script. # chkconfig: - 90 30 # description: Start Perforce broker instance REPL_SDP_INSTANCE # Usage: p4broker_REPL_SDP_INSTANCE_init start|stop|status|restart [ConfigTag] source /p4/common/bin/p4_vars REPL_SDP_INSTANCE || exit 1 declare OpMode=${1:-status} declare ConfigTag=${2:-default} if [[ $ConfigTag == default ]]; then if [[ -r /p4/common/config/${P4SERVER}.broker.${HOSTNAME%%.*}.cfg ]]; then export P4BROKERCFG=${P4CCFG}/${P4SERVER}.broker.${HOSTNAME%%.*}.cfg else export P4BROKERCFG=${P4CCFG}/${P4SERVER}.broker.cfg fi else export P4BROKERCFG=${P4CCFG}/${P4SERVER}.broker.${ConfigTag}.cfg fi source /p4/common/bin/p4broker_base "$OpMode" "$ConfigTag"