diff options
author | Matthias Beyer <matthias.beyer@ifm.com> | 2022-08-18 16:29:49 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@ifm.com> | 2022-08-18 18:09:58 +0200 |
commit | e67ad4d292fb734ed8d6931e7b400cbc2f916dc8 (patch) | |
tree | a0394749089e45239573cf70ceb6b56ba4151cc6 | |
parent | be83fbf4d65f8c508b64cef9abd2f5f0fa3d9092 (diff) |
Add check whether env vars are set
This patch adds a check whether all environment variables expected to be
set are actually set.
Suggested-by: Didier Wenzek <didier.wenzek@free.fr>
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
-rwxr-xr-x | ci/configure_bridge.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ci/configure_bridge.sh b/ci/configure_bridge.sh index 25b8841d..cba16a3e 100755 --- a/ci/configure_bridge.sh +++ b/ci/configure_bridge.sh @@ -1,5 +1,14 @@ #!/bin/bash +for variable in C8YURL C8YUSERNAME C8YPASSWORD C8YDEVICE C8YTENANT C8YDEVICEID; +do + declare -n var_ref=$variable + if [ -z "${var_ref}" ]; then + echo "$variable not set" + exit 1 + fi +done + echo "Disconnect old bridge" # Disconnect - may fail if not there |