summaryrefslogtreecommitdiffstats
path: root/OS/sx-lib.sh
diff options
context:
space:
mode:
Diffstat (limited to 'OS/sx-lib.sh')
-rw-r--r--OS/sx-lib.sh24
1 files changed, 14 insertions, 10 deletions
diff --git a/OS/sx-lib.sh b/OS/sx-lib.sh
index fd2f6b5..362683f 100644
--- a/OS/sx-lib.sh
+++ b/OS/sx-lib.sh
@@ -4,30 +4,34 @@ export TERM=dumb
function check_environment {
if [ ! -v CONTAINER_TYPE ]; then
- echo "ERROR : environment var CONTAINER_TYPE is missing. EXIT !!!"
- exit 1;
+ CONTAINER_TYPE="unknown"
+ export CONTAINER_TYPE
+ echo "! WARNING : environment var CONTAINER_TYPE is missing..."
+ echo "! WARNING : auto-assigned value : $CONTAINER_TYPE"
+ fi
+ if [ ! -v CONTAINER_SERVICE ]; then
+ CONTAINER_SERVICE=$CONTAINER_TYPE;
+ export CONTAINER_SERVICE;
+ echo "! WARNING : environment var CONTAINER_SERVICE is missing..."
+ echo "! WARNING : auto-assigned value : $CONTAINER_SERVICE"
fi
if [ ! -v CONTAINER_INSTANCE ]; then
echo "ERROR : environment var CONTAINER_INSTANCE is missing. EXIT !!!"
exit 1;
fi
- if [ ! -v CONTAINER_SERVICE ]; then
- echo "ERROR : environment var CONTAINER_SERVICE is missing. EXIT !!!"
- exit 1;
- fi
}
function display_container_header {
echo "+====================================================="
- echo "| Container : $HOSTNAME"
+ echo "| Container : $HOSTNAME"
if [ -v CONTAINER_TYPE ]; then
- echo "| Type : $CONTAINER_TYPE"
+ echo "| Type : $CONTAINER_TYPE"
fi
if [ -v CONTAINER_INSTANCE ]; then
- echo "| Instance : $CONTAINER_INSTANCE"
+ echo "| Instance : $CONTAINER_INSTANCE"
fi
if [ -v CONTAINER_SERVICE ]; then
- echo "| Service : $CONTAINER_SERVICE"
+ echo "| Service : $CONTAINER_SERVICE"
fi
echo "+====================================================="
}