diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/copy.sh b/copy.sh old mode 100644 new mode 100755 diff --git a/friendica-clean-database.sh b/friendica-clean-database.sh old mode 100644 new mode 100755 diff --git a/friendica-compress-storage.sh b/friendica-compress-storage.sh old mode 100644 new mode 100755 index 89f2443..f3f2d62 --- a/friendica-compress-storage.sh +++ b/friendica-compress-storage.sh @@ -18,18 +18,19 @@ loop_1() { done elif [[ "${t}" =~ PNG ]]; then nice -n 10 oxipng -o max "${p}" #&> /dev/null - elif [[ "${p}" =~ Web/P ]]; then + elif [[ "${t}" =~ Web/P ]]; then #If file is not animated if [[ -f "${p}" ]]; then - if grep -v -q -e "ANIM" -e "ANMF" "${p}"; then - nice -n 10 cwebp -mt -af -quiet "${p}" -o /tmp/temp.webp #&> /dev/null - if [[ -f /tmp/temp.webp ]]; then - size_new=$(stat -c%s "/tmp/temp.webp" || 0) - size_original=$(stat -c%s "${p}") + if grep -q -a -l -e "ANIM" -e "ANMF" "${p}"; then + tmppic="/tmp/temp_$(date +%s).webp" + nice -n 10 cwebp -mt -af -quiet "${p}" -o "${tmppic}" #&> /dev/null + if [[ -f "${tmppic}" ]]; then + size_new=$(stat -c%s "${tmppic}" 2>/dev/null || echo 0) + size_original=$(stat -c%s "${p}" 2>/dev/null || echo 0) if [[ "${size_original}" -gt "${size_new}" ]]; then - mv /tmp/temp.webp "${p}" #&> /dev/null + mv "${tmppic}" "${p}" #&> /dev/null else - rm /tmp/temp.webp #&> /dev/null + rm "${tmppic}" #&> /dev/null fi fi fi @@ -37,7 +38,7 @@ loop_1() { fi } -find "${folder}/${storagefolder}" -depth -mindepth 2 -type f -size +50k -not -iname "index.html" | ( +find "${folder}/${storagefolder}" -depth -mindepth 2 -type f -size +50k -atime -8 -not -iname "index.html" | ( while read -r p; do loop_1 "${p}" & until [[ $(jobs -r -p | wc -l) -lt $(($(getconf _NPROCESSORS_ONLN) / 2)) ]]; do diff --git a/friendica-delete-non-follower-featured-posts.sh b/friendica-delete-non-follower-featured-posts.sh old mode 100644 new mode 100755 diff --git a/friendica-delete-old-users.sh b/friendica-delete-old-users.sh old mode 100644 new mode 100755 diff --git a/friendica-delete-specific-contact.sh b/friendica-delete-specific-contact.sh old mode 100644 new mode 100755 diff --git a/friendica-find-largest-accounts.sh b/friendica-find-largest-accounts.sh old mode 100644 new mode 100755 diff --git a/friendica-find-missing-servers.sh b/friendica-find-missing-servers.sh old mode 100644 new mode 100755 diff --git a/friendica-fix-avatar-permissions.sh b/friendica-fix-avatar-permissions.sh old mode 100644 new mode 100755 index 4f77e9f..8699ade --- a/friendica-fix-avatar-permissions.sh +++ b/friendica-fix-avatar-permissions.sh @@ -27,7 +27,7 @@ loop_1() { elif [[ "${p}" =~ .webp ]]; then #If file is not animated if [[ -f "${p}" ]]; then - if grep -q -v -e "ANIM" -e "ANMF" "${p}"; then + if grep -q -a -l -e "ANIM" -e "ANMF" "${p}"; then tmppic="/tmp/temp_$(date +%s).webp" nice -n 10 cwebp -mt -af -quiet "${p}" -o "${tmppic}" #&> /dev/null if [[ -f "${tmppic}" ]]; then diff --git a/friendica-remove-invalid-photos.sh b/friendica-remove-invalid-photos.sh old mode 100644 new mode 100755 diff --git a/friendica-remove-old-photos-parallel.sh b/friendica-remove-old-photos-parallel.sh old mode 100644 new mode 100755 diff --git a/friendica-workerqueue.sh b/friendica-workerqueue.sh old mode 100644 new mode 100755 diff --git a/media-optimize-local.sh b/media-optimize-local.sh old mode 100644 new mode 100755 diff --git a/youtube-download-channel.sh b/youtube-download-channel.sh old mode 100644 new mode 100755