From 94cc456b88228e8953a148b61206bfa88cac6db6 Mon Sep 17 00:00:00 2001 From: smathis Date: Tue, 22 Jul 2025 14:16:14 +0200 Subject: [PATCH] Added indirection via startioc so the path is set correctly --- ioc/{startioc.py => pystartioc.py} | 5 +++-- ioc/startioc | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) rename ioc/{startioc.py => pystartioc.py} (95%) create mode 100644 ioc/startioc diff --git a/ioc/startioc.py b/ioc/pystartioc.py similarity index 95% rename from ioc/startioc.py rename to ioc/pystartioc.py index fa6d5ca..74c08d9 100755 --- a/ioc/startioc.py +++ b/ioc/pystartioc.py @@ -37,7 +37,8 @@ def startioc(): f'epicsEnvSet("MASTERMACS1_PORT", "{config["controllers"]["masterMacs1"]["port"]}")\n') # Start the IOC itself - subprocess.run(root_dir + 'ioc/st.cmd') + subprocess.run(root_dir + 'ioc/startioc') -if __name__ == __main__: + +if __name__ == '__main__': startioc() diff --git a/ioc/startioc b/ioc/startioc new file mode 100644 index 0000000..6b8e47a --- /dev/null +++ b/ioc/startioc @@ -0,0 +1,12 @@ +#!/bin/bash +export EPICS_BASE=/usr/local/epics/base-7.0.7 +export EPICS_HOST_ARCH=RHEL8-x86_64 + +# Get the full directory path of the script +SCRIPT_DIR=$(dirname "$(realpath "$0")") + +# Needed so st.cmd finds other .cmd files +cd "$SCRIPT_DIR" || exit 1 + +# Run the IOC shell script +st.cmd \ No newline at end of file