From c9cf5009c1db9b76b17b43781994527d65be0572 Mon Sep 17 00:00:00 2001 From: Daniel Sosnowski Date: Wed, 3 Dec 2025 10:02:20 +0100 Subject: [PATCH] added new loop --- clearCache.sh | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/clearCache.sh b/clearCache.sh index 98a35d8..172b142 100644 --- a/clearCache.sh +++ b/clearCache.sh @@ -19,25 +19,24 @@ then for subscription in "${subscriptionList[@]}" do - - if [[ -d "$subscription/httpdocs/shopsystem/application/cache/boxes" ]] - then - cd "$subscription/httpdocs/shopsystem/application/cache/boxes" - fi - echo -e "Czyszczę cache w subskrybcji $subscription...\n" - ls -1 > "/tmp/dirList.txt" - readarray -t dirList < /tmp/dirList.txt - for dir in "${dirList[@]}" + for path in "$subscription/httpdocs/shopsystem/application/cache/boxes"* "$subscription/httpdocs/shopsystem/appcation/cache/smarty_compiled" do - if [[ -d "$dir" ]] - then - echo -e "Czyszczenie $dir...\n" - cd "$dir" - ls -1 - cd .. - fi + cd "$path" + echo -e "Czyszczę cache w subskrybcji $subscription...\n" + ls -1 > "/tmp/dirList.txt" + readarray -t dirList < /tmp/dirList.txt + for dir in "${dirList[@]}" + do + if [[ -d "$dir" ]] + then + echo -e "Czyszczenie $dir...\n" + cd "$dir" + ls -1 + cd .. + fi + done + cd "$vhostDir" done - cd "$vhostDir" done fi