#!/bin/sh

depfile="/opt/webservice/install/deployment.properties"
if [ ! -f "$depfile" ]; then
  echo "Could not find $depfile -> assuming standalone"
  exit 1
fi

. /opt/webservice/install/deployment.properties

deployment=`/opt/webservice/scripts/gethaipsetupentry.sh system.multiNodeSystem`
rc=$?
if [ "$rc" != "0" ]; then
 echo "Could not find haipsetup.xml or multiNodeSystem -> assuming standalone"
 exit 1
fi

is_container=0
if [ -f /opt/soco/native/os/linux/is_container.sh ]; then
  /opt/soco/native/os/linux/is_container.sh
  rc=$?
  if [ ${rc} == "0" ]; then
    is_container=0
  else
    is_container=1
  fi
fi

if [ "${is_container}" = "1" ]; then
  echo "Deployment is Standalone Softgate on EntGW"
  exit 1
fi

case $deployment in
   $DEP_STANDALONE_SG)
          echo "Deployment is Standalone Softgate"
          exit 1
          ;;
   $DEP_UNDEFINED)
          echo "Deployment is still undefined  -> assuming standalone"
          exit 1
          ;;          
   *)     
          echo "Deployment is defined -> obviously not standalone"
          exit 0
esac

