Commit c6c7b1b7 authored by gauthier's avatar gauthier

Automaticaly generate certificate for S6A

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5147 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 3169792e
......@@ -30,7 +30,8 @@ MME :
S6A :
{
S6A_CONF = "../objs/UTILS/CONF/s6a.conf";
# pwd=$OPENAIR_CN/objs
S6A_CONF = "./UTILS/CONF/s6a.conf";
};
# ------- SCTP definitions
......
......@@ -284,6 +284,7 @@ fi
##################################################
# LAUNCH MME + S+P-GW executable
##################################################
check_s6a_certificate
cd $OPENAIRCN_DIR/$OBJ_DIR
......
......@@ -1071,6 +1071,27 @@ clean_network() {
done
}
check_s6a_certificate() {
if [ -d /usr/local/etc/freeDiameter ]
then
if [ -f /usr/local/etc/freeDiameter/user.cert.pem ]
then
full_hostname=`cat /usr/local/etc/freeDiameter/user.cert.pem | grep "Subject" | grep "CN" | cut -d '=' -f6`
if [ a$full_hostname == a`hostname`.eur ]
then
echo_success "S6A: Found valid certificate in /usr/local/etc/freeDiameter"
return 1
fi
fi
fi
echo_error "S6A: Did not find valid certificate in /usr/local/etc/freeDiameter"
echo_warning "S6A: generatting new certificate in /usr/local/etc/freeDiameter..."
cd $OPENAIRCN_DIR/S6A/freediameter
./make_certs.sh
check_s6a_certificate
return 1
}
###########################################################
IPTABLES=/sbin/iptables
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment