From 80e9d3dd38d7539071e2903e7eef5a628be95c29 Mon Sep 17 00:00:00 2001
From: Jameson Graef Rollins <jameson.rollins@ligo.org>
Date: Mon, 1 Jun 2020 14:10:14 -0700
Subject: [PATCH] support: check SITE/IFO vars in module wrapper script

---
 support/bin/rts_module_ctrl | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/support/bin/rts_module_ctrl b/support/bin/rts_module_ctrl
index e5ad15861..53b36df95 100755
--- a/support/bin/rts_module_ctrl
+++ b/support/bin/rts_module_ctrl
@@ -3,9 +3,17 @@
 cmd="$1"
 sys="$2"
 if [ -z "$sys" ] ; then
-    echo "usage: $(basename $0) start|stop <sys>"
+    echo "usage: $(basename $0) start|stop <sys>" >&2
     exit 1
 fi
+if [ -z "$SITE" ] ; then
+    echo "SITE variable not specified." >&2
+    exit 2
+fi
+if [ -z "$IFO" ] ; then
+    echo "IFO variable not specified." >&2
+    exit 2
+fi
 TARGET=/opt/rtcds/${SITE,,*}/${IFO,,*}
 case $cmd in
     start)
-- 
GitLab