From d2137256ffc55ae578f4b036734dab61c3903f64 Mon Sep 17 00:00:00 2001 From: "Darren L. Weber, Ph.D" Date: Wed, 5 Jul 2017 15:22:55 -0700 Subject: [PATCH] bin/sdr-preservation-core_status.sh - utility script to report robot status --- bin/sdr-preservation-core_status.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bin/sdr-preservation-core_status.sh diff --git a/bin/sdr-preservation-core_status.sh b/bin/sdr-preservation-core_status.sh new file mode 100755 index 0000000..d77c9d7 --- /dev/null +++ b/bin/sdr-preservation-core_status.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# The ROBOT_ENVIRONMENT values here should match the +# environment files in the shared configs at +# https://github.com/sul-dlss/sdr-configs/tree/master/sdr-preservation-core/config/environments + +if hostname | egrep -q '\-dev'; then + export ROBOT_ENVIRONMENT='integration' +fi +if hostname | egrep -q '\-test|\-stage'; then + export ROBOT_ENVIRONMENT='test' +fi +if hostname | egrep -q '\-prod'; then + export ROBOT_ENVIRONMENT='production' +fi + +echo "Using ROBOT_ENVIRONMENT=$ROBOT_ENVIRONMENT" +cd ~/sdr-preservation-core/current +bundle exec controller status