added and if instruction

This commit is contained in:
Daniel Sosnowski
2025-12-04 14:58:15 +01:00
parent 892593ebe2
commit 1f02319909

View File

@@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
function loopDirs {
}
declare -i diskUsage declare -i diskUsage
vhostDir="/var/www/vhosts" vhostDir="/var/www/vhosts"
@@ -21,24 +25,27 @@ then
do do
for path in "$subscription/httpdocs/shopsystem/application/cache/boxes"* "$subscription/httpdocs/shopsystem/appcation/cache/smarty_compiled" for path in "$subscription/httpdocs/shopsystem/application/cache/boxes"* "$subscription/httpdocs/shopsystem/appcation/cache/smarty_compiled"
do do
cd "$path"
echo -e "Czyszczę cache w subskrybcji $subscription...\n" if [[ -d $path ]]
ls -1 > "/tmp/dirList.txt" then
readarray -t dirList < /tmp/dirList.txt cd "$path"
for dir in "${dirList[@]}" echo -e "Czyszczę cache w subskrybcji $subscription...\n"
do ls -1 > "/tmp/dirList.txt"
if [[ -d "$dir" ]] readarray -t dirList < /tmp/dirList.txt
then for dir in "${dirList[@]}"
echo -e "Czyszczenie $dir...\n" do
cd "$dir" if [[ -d "$dir" ]]
ls -1 then
cd .. echo -e "Czyszczenie $dir...\n"
fi cd "$dir"
ls -1
cd ..
fi
done
fi
cd "$vhostDir"
done done
cd "$vhostDir"
done done
done
fi fi
if [[ -f "/tmp/subscriptions.txt" ]] && [[ -f "/tmp/dirList.txt" ]] if [[ -f "/tmp/subscriptions.txt" ]] && [[ -f "/tmp/dirList.txt" ]]