chore: Add Shellcheck suggestions

This commit is contained in:
Carlos Solís 2025-01-24 19:27:44 +00:00
parent 7f2b750466
commit 06356b6d1c
3 changed files with 5 additions and 5 deletions

View file

@ -39,7 +39,7 @@ then
echo "Amount of unique sites: ${#sites[@]}" echo "Amount of unique sites: ${#sites[@]}"
for a in "${sites[@]}" for a in "${sites[@]}"
do do
loop_1 $a & loop_1 "$a" &
if [[ $(jobs -r -p | wc -l) -ge $(expr $(getconf _NPROCESSORS_ONLN)*2) ]] if [[ $(jobs -r -p | wc -l) -ge $(expr $(getconf _NPROCESSORS_ONLN)*2) ]]
then then
wait -n wait -n
@ -56,7 +56,7 @@ then
then then
for b in "${sitesdown[@]}" for b in "${sitesdown[@]}"
do do
loop_2 $b & loop_2 "$b" &
if [[ $(jobs -r -p | wc -l) -ge $(expr $(getconf _NPROCESSORS_ONLN)/2) ]] if [[ $(jobs -r -p | wc -l) -ge $(expr $(getconf _NPROCESSORS_ONLN)/2) ]]
then then
wait -n wait -n
@ -67,7 +67,7 @@ then
fi fi
while read -r lineb; do while read -r lineb; do
#The community no longer exists, delete #The community no longer exists, delete
loop_3 $lineb & loop_3 "$lineb" &
if [[ $(jobs -r -p | wc -l) -ge $(expr $(getconf _NPROCESSORS_ONLN)/2) ]] if [[ $(jobs -r -p | wc -l) -ge $(expr $(getconf _NPROCESSORS_ONLN)/2) ]]
then then
wait -n wait -n

View file

@ -40,7 +40,7 @@ grep -e "https://$site/$avatarfolder/" "$tmpfile" | sed -e "s/.*$site/$folderesc
#Specific compression for large GIF files #Specific compression for large GIF files
while [[ $(stat -c%s "${p}") -ge 512000 ]] while [[ $(stat -c%s "${p}") -ge 512000 ]]
do do
gifsicle "${p}" `seq -f "#%g" 0 2 99` -O3 --lossy=80 --colors=255 -o "${p}" & #&> /dev/null gifsicle "${p}" $(seq -f "#%g" 0 2 99) -O3 --lossy=80 --colors=255 -o "${p}" & #&> /dev/null
if [[ $(jobs -r -p | wc -l) -ge $(getconf _NPROCESSORS_ONLN) ]] if [[ $(jobs -r -p | wc -l) -ge $(getconf _NPROCESSORS_ONLN) ]]
then then
wait -n wait -n

View file

@ -46,7 +46,7 @@ IFS="
size_original=$(stat -c%s "${s}") size_original=$(stat -c%s "${s}")
if [ "$size_original" -gt "$size_new" ] if [ "$size_original" -gt "$size_new" ]
then then
mv /tmp/"${s##.*\/}"_temp.webp $s mv /tmp/"${s##.*\/}"_temp.webp "$s"
else else
rm /tmp/"${s##.*\/}"_temp.webp rm /tmp/"${s##.*\/}"_temp.webp
fi fi