blob: fd1096d6e10b945dfea0a29990d5a3cb0c8e951c [file] [log] [blame]
Jeremy Ronquillo223db002020-06-05 10:28:22 -07001#!/bin/bash
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07002
Jeremy Ronquillo223db002020-06-05 10:28:22 -07003# Copyright 2019-present Open Networking Foundation
4#
Jeremy Ronquillo6046ce32020-06-18 11:06:29 -07005# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
Jeremy Ronquillo223db002020-06-05 10:28:22 -07006
Ajay Lotan Thakurc3cd6192020-10-12 20:12:38 -05007APPLICATION=$1
Jeremy Ronquillo223db002020-06-05 10:28:22 -07008set -xe
9
Jeremy Ronquillo223db002020-06-05 10:28:22 -070010mkdir -p /opt/cp/config
11cd /opt/cp/config
Ajay Lotan Thakuraec2a1c2021-03-31 20:18:17 -050012cp /etc/cp/config/{*.json,*.conf} .
Jeremy Ronquillo223db002020-06-05 10:28:22 -070013
Ajay Lotan Thakurc3cd6192020-10-12 20:12:38 -050014case $APPLICATION in
15 "ngic_controlplane")
16 echo "Starting ngic controlplane app"
Ajay Lotan Thakuraec2a1c2021-03-31 20:18:17 -050017 cat /opt/cp/config/cp.json
Ajay Lotan Thakurc3cd6192020-10-12 20:12:38 -050018 cat /opt/cp/config/subscriber_mapping.json
19 {{- if .Values.config.coreDump.enabled }}
20 cp /bin/ngic_controlplane /tmp/coredump/
21 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070022
Ajay Lotan Thakuraec2a1c2021-03-31 20:18:17 -050023 ngic_controlplane -f /etc/cp/config/
Ajay Lotan Thakurc3cd6192020-10-12 20:12:38 -050024 ;;
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