added and if instruction
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
function loopDirs {
|
||||
|
||||
}
|
||||
|
||||
declare -i diskUsage
|
||||
vhostDir="/var/www/vhosts"
|
||||
|
||||
@@ -21,24 +25,27 @@ then
|
||||
do
|
||||
for path in "$subscription/httpdocs/shopsystem/application/cache/boxes"* "$subscription/httpdocs/shopsystem/appcation/cache/smarty_compiled"
|
||||
do
|
||||
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
|
||||
done
|
||||
|
||||
if [[ -d $path ]]
|
||||
then
|
||||
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
|
||||
fi
|
||||
cd "$vhostDir"
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ -f "/tmp/subscriptions.txt" ]] && [[ -f "/tmp/dirList.txt" ]]
|
||||
|
||||
Reference in New Issue
Block a user