#!/bin/bash
#==============================================================
# luCamacIocAltPorts
#
# ARGUMENTS:
#
# OPTION:     
#
# Facility:  SLAC/LCLS
#
# For a Linac Upgrade CAMAC IOC, change the startup file to use the
# alternate production EPICS CA ports and then reboot the ioc 
# (perform hard reset as soft reset PV will not work when on alt ports).
#
# Usage: luCamacIocAltPorts <location>
#
# Arguments: 
#            location: ioc location name, for example li28
# 
#----------------------------------------------------------------------------
# Mod:
#        
#==============================================================

loca=`echo $1 | tr '[:upper:]' '[:lower:]'`

LOCA=`echo $1 | tr '[:lower:]' '[:upper:]'`

echo  Rebooting ${LOCA} CAMAC IOC with alternate Channel Access configuration...

cp $EPICS_IOCS/ioc-${loca}-cv01/altports_startup.cmd $EPICS_IOCS/ioc-${loca}-cv01/startup.cmd

caput CRAT:${LOCA}:CV01:HARDRESET 1

exit 0

