From e3754f43caa7e527f0d0db0c24a089d255ff4de7 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Wed, 28 Jan 2026 17:08:10 -0800 Subject: [PATCH 1/2] ENH: add xrt to camviewer script, don't ssh if you don't need to --- scripts/camViewer | 7 +++++-- scripts/verify-hutch | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/camViewer b/scripts/camViewer index 3c5f0668..77e6fa05 100755 --- a/scripts/camViewer +++ b/scripts/camViewer @@ -302,6 +302,8 @@ if [ "$CAMNUM" -eq 0 ]; then CAMNAME=GigE_Questar1 elif [ "$hutch" = "lfe" ]; then CAMNAME=xrt_spec + elif [ "$hutch" = "xrt" ]; then + CAMNAME=xrt_spec elif [ "$hutch" = "ued" ]; then CAMNAME=ued-gige-01 else @@ -384,14 +386,15 @@ else echo 'cannot check Acquiring PV, try to open camera viewer anyways....' fi +current_host="$(hostname)" if [[ -z "$IS_REMOTE_SSH" ]]; then - if [ "$hutch" == "kfe" ]; then + if [ "$hutch" == "kfe" ] && [ "$current_host" != "kfe-console" ]; then echo "Not in SSH, connecting to kfe-console..." >&2 ssh -t kfe-console "IS_REMOTE_SSH=1 $EXE --camerapv '$CAMPVFULL' --instrument '$hutch' --pvlist '$PVLIST' --rate '$RATE' ; bash" exit_status=$? echo "SSH exit status: $exit_status" >&2 exit $exit_status - elif [ "$hutch" == "lfe" ]; then + elif [ "$hutch" == "lfe" ] || [ "$hutch" == "xrt" ] && [ "$current_host" != "lfe-console" ]; then echo "Not in SSH, connecting to lfe-console..." >&2 ssh -t lfe-console "IS_REMOTE_SSH=1 $EXE --camerapv '$CAMPVFULL' --instrument '$hutch' --pvlist '$PVLIST' --rate '$RATE' ; bash" exit_status=$? diff --git a/scripts/verify-hutch b/scripts/verify-hutch index 71cb065b..547fbd19 100755 --- a/scripts/verify-hutch +++ b/scripts/verify-hutch @@ -20,7 +20,7 @@ if [[ ($1 == "--help") || ($1 == "-h") ]]; then fi hutch=${1,,} -for i in "tmo" "txi" "rix" "xpp" "xcs" "mfx" "cxi" "mec" "ued" "ued" "det" "lfe" "kfe" "tst" "las" "hpl"; do +for i in "tmo" "txi" "rix" "xpp" "xcs" "mfx" "cxi" "mec" "ued" "ued" "det" "lfe" "kfe" "xrt" "tst" "las" "hpl"; do if [[ $hutch == "$i" ]]; then exit 0 fi From a9f4e098d1a6ec5442a7495aaa0e3aae51bf0061 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Thu, 29 Jan 2026 11:31:28 -0800 Subject: [PATCH 2/2] FIX: clean up logic and include xbdo-control --- scripts/camViewer | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/camViewer b/scripts/camViewer index 77e6fa05..4741dca4 100755 --- a/scripts/camViewer +++ b/scripts/camViewer @@ -386,15 +386,15 @@ else echo 'cannot check Acquiring PV, try to open camera viewer anyways....' fi -current_host="$(hostname)" if [[ -z "$IS_REMOTE_SSH" ]]; then - if [ "$hutch" == "kfe" ] && [ "$current_host" != "kfe-console" ]; then + current_host="$(hostname)" + if [[ "$hutch" == "kfe" && "$current_host" != "kfe-console" && "$current_host" != "xbdo-control" ]]; then echo "Not in SSH, connecting to kfe-console..." >&2 ssh -t kfe-console "IS_REMOTE_SSH=1 $EXE --camerapv '$CAMPVFULL' --instrument '$hutch' --pvlist '$PVLIST' --rate '$RATE' ; bash" exit_status=$? echo "SSH exit status: $exit_status" >&2 exit $exit_status - elif [ "$hutch" == "lfe" ] || [ "$hutch" == "xrt" ] && [ "$current_host" != "lfe-console" ]; then + elif [[ ("$hutch" == "lfe" || "$hutch" == "xrt") && "$current_host" != "lfe-console" && "$current_host" != "xbdo-control" ]]; then echo "Not in SSH, connecting to lfe-console..." >&2 ssh -t lfe-console "IS_REMOTE_SSH=1 $EXE --camerapv '$CAMPVFULL' --instrument '$hutch' --pvlist '$PVLIST' --rate '$RATE' ; bash" exit_status=$?