From 05c9aa4a4d3572168878bf0e81eeac724a95454d Mon Sep 17 00:00:00 2001 From: startxfr Date: Sat, 28 Nov 2015 16:00:38 +0100 Subject: change in apache script for handling ServerName --- OS/sx-lib.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'OS') 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 "+=====================================================" } -- cgit v1.2.3