Check file name and set rights

#!/bin/bash

change_rights() {
for i in $(find $1 -perm 700); do
echo "set rights for $i"
chmod a+rw $i
done

for i in $(find $1 -perm 600); do
echo "set rights for $i"
chmod a+rw $i
done
}

change_name() {
for i in $(find $1 -name "*.JPG"); do
echo "rename $i ${i//.JPG/.jpg}"
mv "$i" "${i//.JPG/.jpg}"
done
}

for DIR in /data/bilder/300dpi /data/bilder/700dpi; do
change_rights $DIR
change_name $DIR
done