|
|
|
|
@ -484,7 +484,7 @@ awk -v gateway_key="$FBP_KEY" \
|
|
|
|
|
|
|
|
|
|
if [ "$native_count" -eq 0 ]
|
|
|
|
|
then
|
|
|
|
|
awk -v relationships="$RELATIONSHIPS" -v aprs_call="$APRS_CALL" -v aprs_passcode="$APRS_PASSCODE" '
|
|
|
|
|
awk -v relationships="$RELATIONSHIPS" -v base_id="$BASE_ID" -v aprs_call="$APRS_CALL" -v aprs_passcode="$APRS_PASSCODE" '
|
|
|
|
|
function print_gateway() {
|
|
|
|
|
print " data-gateway:"
|
|
|
|
|
print " container_name: freedmr-data-gateway"
|
|
|
|
|
@ -503,6 +503,7 @@ then
|
|
|
|
|
print " FREEDMR_GATEWAY_INGRESS_MODE: fbp"
|
|
|
|
|
print " FREEDMR_GATEWAY_FBP_RELATIONSHIPS: \047" relationships "\047"
|
|
|
|
|
print " FREEDMR_GATEWAY_FBP_RELATIONSHIPS_FILE: /config/data-gateway-relationships.json"
|
|
|
|
|
print " FREEDMR_GATEWAY_FBP_SOURCE_SERVER_ID: \047" base_id "\047"
|
|
|
|
|
print " FREEDMR_GATEWAY_RADIOID_PATH: /data/subscriber_ids.json"
|
|
|
|
|
print " FREEDMR_GATEWAY_APRS_HOST: rotate.aprs2.net"
|
|
|
|
|
print " FREEDMR_GATEWAY_APRS_PORT: \04714580\047"
|
|
|
|
|
@ -555,9 +556,10 @@ else
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
COMPOSE_WITH_RELATIONSHIPS_FILE="$WORK_DIR/docker-compose.with-relationships-file.yml"
|
|
|
|
|
awk '
|
|
|
|
|
awk -v base_id="$BASE_ID" '
|
|
|
|
|
function flush_gateway( i, inline_index, volumes_index, networks_index,
|
|
|
|
|
file_seen, mount_seen, list_environment) {
|
|
|
|
|
environment_index, file_seen, mount_seen,
|
|
|
|
|
source_seen, list_environment) {
|
|
|
|
|
if (!gateway_count)
|
|
|
|
|
return
|
|
|
|
|
for (i = 1; i <= gateway_count; i++) {
|
|
|
|
|
@ -570,6 +572,10 @@ awk '
|
|
|
|
|
}
|
|
|
|
|
if (gateway[i] ~ /FREEDMR_GATEWAY_FBP_RELATIONSHIPS_FILE/)
|
|
|
|
|
file_seen = 1
|
|
|
|
|
if (gateway[i] ~ /FREEDMR_GATEWAY_FBP_SOURCE_SERVER_ID/)
|
|
|
|
|
source_seen = 1
|
|
|
|
|
if (gateway[i] ~ /^[[:space:]]*environment:[[:space:]]*$/)
|
|
|
|
|
environment_index = i
|
|
|
|
|
if (gateway[i] ~ /^[[:space:]]*volumes:[[:space:]]*$/)
|
|
|
|
|
volumes_index = i
|
|
|
|
|
if (gateway[i] ~ /^[[:space:]]*networks:[[:space:]]*$/ && !networks_index)
|
|
|
|
|
@ -587,6 +593,12 @@ awk '
|
|
|
|
|
print " - \047/etc/freedmr/data-gateway-relationships.json:/config/data-gateway-relationships.json:ro\047"
|
|
|
|
|
}
|
|
|
|
|
print gateway[i]
|
|
|
|
|
if (!source_seen && environment_index == i) {
|
|
|
|
|
if (list_environment)
|
|
|
|
|
print " - FREEDMR_GATEWAY_FBP_SOURCE_SERVER_ID=" base_id
|
|
|
|
|
else
|
|
|
|
|
print " FREEDMR_GATEWAY_FBP_SOURCE_SERVER_ID: \047" base_id "\047"
|
|
|
|
|
}
|
|
|
|
|
if (!file_seen && inline_index == i) {
|
|
|
|
|
if (list_environment)
|
|
|
|
|
print " - FREEDMR_GATEWAY_FBP_RELATIONSHIPS_FILE=/config/data-gateway-relationships.json"
|
|
|
|
|
|