fix for ubuntu 24.04

This commit is contained in:
Sebastian
2025-01-04 01:49:46 +01:00
parent 5169fe0751
commit 5ac00a77b3

View File

@@ -11,19 +11,17 @@ done < "$BASEPATH/path-blacklist.txt"
# Parse Docker Compose file to get all services
services=$(cat $BASEPATH/$1.yml | yaml2json | jq -r '.services | keys | .[]')
echo $services
for service in $services; do
IFS=$'\t' read -r -a labels <<< $(cat "$BASEPATH/$1.yml" | yaml2json | jq -r ".services[\"$service\"].labels[]")
labels=($(cat "$BASEPATH/$1.yml" | yaml2json | jq -r ".services[\"$service\"].labels[]"))
for label in "${labels[@]}"; do
if [[ "$label" == *"stripprefix.prefixes"* ]]; then
echo $label
path=$(echo "$label" | cut -d "=" -f 2)
break # Stop looping after finding the first match
fi
done
include=true
for word in "${blacklist[@]}"; do
if echo "$path" | grep -qE "$word"; then
@@ -32,7 +30,7 @@ echo $label
done
if $include; then
# IFS=$'\t' read -r -a labels <<< $(cat "$BASEPATH/$1.yml" | yaml2json | jq -r ".services[\"$service\"].labels[]")
for label in "${labels[@]}"; do
if [[ "$label" == *"loadbalancer.server.port"* ]]; then
port=$(echo "$label" | cut -d "=" -f 2)