From 94772a812959329057df15a85380e8674bfcbb94 Mon Sep 17 00:00:00 2001 From: Jean Froment Date: Sun, 6 Mar 2022 22:27:22 +0100 Subject: [PATCH] Fix middleware counter init in loop --- run-seedbox.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run-seedbox.sh b/run-seedbox.sh index a44219e..3c3e26a 100755 --- a/run-seedbox.sh +++ b/run-seedbox.sh @@ -194,7 +194,6 @@ for json in $(yq eval -o json config.yaml | jq -c ".services[]"); do # Loop over all Traefik rules and create the corresponding entries in the generated rules.yaml echo-debug "[$0] Generating Traefik rules..." i=0 - middlewareCount=0 for rule in $(echo $json | jq -c .traefik.rules[]); do ((i=i+1)) host=$(echo $rule | jq -r .host) @@ -218,6 +217,8 @@ for json in $(yq eval -o json config.yaml | jq -c ".services[]"); do ruleId="${name}-${i}" echo 'http.routers.'"${ruleId}"'.rule: Host(`'${hostTraefik}'`)' >> rules.props + + middlewareCount=0 if [[ ${httpAuth} == "true" ]]; then echo "http.routers.${ruleId}.middlewares.${middlewareCount}: common-auth@file" >> rules.props ((middlewareCount=middlewareCount+1))