-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathercoleweb-setup
executable file
·26 lines (21 loc) · 1.6 KB
/
ercoleweb-setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
# Get the required value
API_SERVICE_REMOTE_ENDPOINT=$(grep "FE.APIService.RemoteEndpoint" /etc/ercole/conf.d/20-ercolesetup.toml | cut -d'=' -f2 | sed -e 's/[[:space:]]*"//' | sed -e 's/"[[:space:]]*//')
if [ -z "$API_SERVICE_REMOTE_ENDPOINT" ]; then
API_SERVICE_REMOTE_ENDPOINT="/api"
fi
CHART_SERVICE_REMOTE_ENDPOINT=$(grep "FE.ChartService.RemoteEndpoint" /etc/ercole/conf.d/20-ercolesetup.toml | cut -d'=' -f2 | sed -e 's/[[:space:]]*"//' | sed -e 's/"[[:space:]]*//')
if [ -z "$CHART_SERVICE_REMOTE_ENDPOINT" ]; then
CHART_SERVICE_REMOTE_ENDPOINT="/chart"
fi
THUNDER_SERVICE_REMOTE_ENDPOINT=$(grep "FE.ThunderService.RemoteEndpoint" /etc/ercole/conf.d/20-ercolesetup.toml | cut -d'=' -f2 | sed -e 's/[[:space:]]*"//' | sed -e 's/"[[:space:]]*//')
if [ -z "$THUNDER_SERVICE_REMOTE_ENDPOINT" ]; then
THUNDER_SERVICE_REMOTE_ENDPOINT="/thunder"
fi
REPO_SERVICE_REMOTE_ENDPOINT=$(grep "FE.RepoService.RemoteEndpoint" /etc/ercole/conf.d/20-ercolesetup.toml | cut -d'=' -f2 | sed -e 's/[[:space:]]*"//' | sed -e 's/"[[:space:]]*//')
if [ -z "$REPO_SERVICE_REMOTE_ENDPOINT" ]; then
REPO_SERVICE_REMOTE_ENDPOINT="/repo"
fi
if [ -n "$API_SERVICE_REMOTE_ENDPOINT" ] && [ -n "$CHART_SERVICE_REMOTE_ENDPOINT" ] && [ -n "$THUNDER_SERVICE_REMOTE_ENDPOINT" ] && [ -n "$REPO_SERVICE_REMOTE_ENDPOINT" ]; then
echo -e "{ \n\t\"APIServiceBaseUrl\":\"${API_SERVICE_REMOTE_ENDPOINT}\", \n\t\"ChartServiceBaseUrl\":\"${CHART_SERVICE_REMOTE_ENDPOINT}\", \n\t\"ThunderServiceBaseUrl\":\"${THUNDER_SERVICE_REMOTE_ENDPOINT}\", \n\t\"RepoServiceBaseUrl\":\"${REPO_SERVICE_REMOTE_ENDPOINT}\"\n }" > /usr/share/ercole/web/config.json
fi