blob: e06cbde379294f3189056fa621771ae0a226f5bd [file] [log] [blame]
badhri854c028b32021-11-03 18:24:05 -05001#!/bin/bash
2
3# Copyright 2019-present Open Networking Foundation
4#
Ajay Lotan Thakur03189d22022-02-10 14:06:03 -06005# SPDX-License-Identifier: Apache-2.0
badhri854c028b32021-11-03 18:24:05 -05006
7APPLICATION=$1
8set -xe
9
10mkdir -p /opt/cp/config
11cd /opt/cp/config
12cp /etc/cp/config/{*.json,*.conf} .
13
14case $APPLICATION in
15 "ngic_controlplane")
16 echo "Starting ngic controlplane app"
17 cat /opt/cp/config/cp.json
18 cat /opt/cp/config/subscriber_mapping.json
19 {{- if .Values.config.coreDump.enabled }}
20 cp /bin/ngic_controlplane /tmp/coredump/
21 {{- end }}
22
23 ngic_controlplane -f /etc/cp/config/
24 ;;
25
26 "gx-app")
27 echo "Starting gx-app"
28 SPGWC_IDENTITY={{ tuple "spgwc" "identity" . | include "omec-control-plane.diameter_endpoint" | quote }};
29 DIAMETER_HOST=$(echo $SPGWC_IDENTITY| cut -d'.' -f1)
30 DIAMETER_REALM={{ tuple "spgwc" "realm" . | include "omec-control-plane.diameter_endpoint" | quote }};
31 chmod +x /bin/make_certs.sh
32 cp /bin/make_certs.sh /opt/cp/config
33 /bin/make_certs.sh $DIAMETER_HOST $DIAMETER_REALM
34 {{- if .Values.config.coreDump.enabled }}
35 cp /bin/gx_app /tmp/coredump/
36 {{- end }}
37 cd /opt/cp/
38 gx_app
39 ;;
40
41 *)
42 echo "invalid app $APPLICATION"
43 ;;
44esac