Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Jeremy Ronquillo | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame] | 2 | |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 3 | # Copyright 2019-present Open Networking Foundation |
| 4 | # |
Jeremy Ronquillo | 6046ce3 | 2020-06-18 11:06:29 -0700 | [diff] [blame] | 5 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 6 | |
Ajay Lotan Thakur | c3cd619 | 2020-10-12 20:12:38 -0500 | [diff] [blame] | 7 | APPLICATION=$1 |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 8 | set -xe |
| 9 | |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 10 | mkdir -p /opt/cp/config |
| 11 | cd /opt/cp/config |
Ajay Lotan Thakur | aec2a1c | 2021-03-31 20:18:17 -0500 | [diff] [blame] | 12 | cp /etc/cp/config/{*.json,*.conf} . |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 13 | |
Ajay Lotan Thakur | c3cd619 | 2020-10-12 20:12:38 -0500 | [diff] [blame] | 14 | case $APPLICATION in |
| 15 | "ngic_controlplane") |
| 16 | echo "Starting ngic controlplane app" |
Ajay Lotan Thakur | aec2a1c | 2021-03-31 20:18:17 -0500 | [diff] [blame] | 17 | cat /opt/cp/config/cp.json |
Ajay Lotan Thakur | c3cd619 | 2020-10-12 20:12:38 -0500 | [diff] [blame] | 18 | cat /opt/cp/config/subscriber_mapping.json |
| 19 | {{- if .Values.config.coreDump.enabled }} |
| 20 | cp /bin/ngic_controlplane /tmp/coredump/ |
| 21 | {{- end }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 22 | |
Ajay Lotan Thakur | aec2a1c | 2021-03-31 20:18:17 -0500 | [diff] [blame] | 23 | ngic_controlplane -f /etc/cp/config/ |
Ajay Lotan Thakur | c3cd619 | 2020-10-12 20:12:38 -0500 | [diff] [blame] | 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 | ;; |
| 44 | esac |