From 5169fe07514dd084db834ff5bff70fa73bd1767b Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Sat, 4 Jan 2025 01:30:24 +0100 Subject: [PATCH] fix for ubuntu 24.04 --- get-local-url.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/get-local-url.sh b/get-local-url.sh index 32ddd240..460d8db2 100755 --- a/get-local-url.sh +++ b/get-local-url.sh @@ -9,19 +9,16 @@ while IFS= read -r line; do blacklist+=("$line") done < "$BASEPATH/path-blacklist.txt" -y2j() { - python3 -c 'import sys, yaml, json; print(json.dumps(yaml.safe_load(sys.stdin.read())))' < "$1" -} - # Parse Docker Compose file to get all services -services=$(y2j $BASEPATH/$1.yml | jq -r '.services | keys | .[]') +services=$(cat $BASEPATH/$1.yml | yaml2json | jq -r '.services | keys | .[]') echo $services for service in $services; do - IFS=$'\t' read -r -a labels <<< $(y2j "$BASEPATH/$1.yml" | jq -r ".services[\"$service\"].labels | @tsv") + IFS=$'\t' read -r -a 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