#!/bin/bash

# @file namespace
#
# Copyright (C) Metaswitch Networks 2014
# If license terms are provided to you in a COPYING file in the root directory
# of the source code repository by which you are accessing this code, then
# the license outlined in that COPYING file applies to your use.
# Otherwise no rights are granted except for those provided to you by
# Metaswitch Networks in a separate written agreement.


# This script verifies that a signaling namespace defined in config 
# matches an actual network namespace in the kernel. If it does not, 
# an ENT log is generated. 


. /etc/clearwater/config

if [ -n "$signaling_namespace" ]
then
  for ns in `ip netns list`
  do
    [ "$signaling_namespace" == "$ns" ] && exit 0
  done

  /usr/share/clearwater/bin/ent_log.py namespace CL_SIG_NS_MISMATCH $signaling_namespace
fi

