#==============================================================
#
#  Abs:  Common soft IOCS startup script, which loads db, restore 
#        and starts EPICS and sequences
#
#  Name: st.cmd.soft.all
#
#  Rem:  Upon entry we expect to be at location TOP
#        and the following macros must be defined.
#        Note that all other environment variables 
#        used within this file are defined in envPaths.
#
#           EPICS_IOCS  - Top level boot dir for all iocs
#           IOC         - IOC name in lower case
#           IOC_NAME    - IOC Device name   (ie. SIOC:BSY0:MG01)
#           IOC_NODE    - Node name of ioc  (ie. SIOC-BSY0-MG01)
#           IOC_RESTORE - Restore directory CW files  
#
#         Upon exit, this script will leave the ioc sitting
#         at the same location upon entry.
#
#  Facility: SLAC Magnet Controls
#
#  Auth: 29-Aug-2019, Kristi Luchini  (LUCHINI)
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        09-Jun-2021, K. Luchini      (LUCHINI):
#          renamed from st.cmd.soft.mcor
#
#==============================================================

# Magnet device database
dbLoadRecords("db/${IOC}.db")

# Restore PVs
dbRestore("${IOC_RESTORE}/${IOC_NODE}.sav",0,0)
dbRestore("${IOC_RESTORE}/${IOC_NODE}_static.sav",0,0)

# Change to boot directory
cd ${IOC_BOOT}

# Start EPICS
iocInit()

# Initialize caPutLog
caPutLogInit("${EPICS_CA_PUT_LOG_ADDR}")

# Start any sequence programs
< init_seq.cmd

# End of script






