Updates some scripts
This commit is contained in:
@@ -59,7 +59,7 @@ furry_commission_ideas_path=/mnt/e/clouds/nextcloud/furry-downloads
|
||||
# furry_commission_ideas_path=/mnt/e/home/documents-unsorted/data-hoarding/furry-downloads
|
||||
# furry_commission_ideas_path=/mnt/e/home/downloads/furry-downloads
|
||||
furry_commission_ideas_urls_filename="urls.txt"
|
||||
scripts_path=/home/cloud/repos/personal-devboot/scripts/shell
|
||||
scripts_path=/home/cloud/git/personal-devboot/scripts/shell
|
||||
|
||||
if [ ! -d $furry_commission_ideas_path ]; then
|
||||
echo "[ERROR] The images folder was not found (\"$furry_commission_ideas_path\")"
|
||||
@@ -231,7 +231,7 @@ existing_folders=()
|
||||
|
||||
fill_existing_folders_array() {
|
||||
ignore_paths=("artists" "kinks" "ideas")
|
||||
ignore_paths_depth_2=("artists" "favorites")
|
||||
ignore_paths_depth_2=("artists")
|
||||
ignore_paths_depth_last=("no-source" ".bsky.social" "old" "mine")
|
||||
|
||||
find_command="find * -type d"
|
||||
|
||||
@@ -9,8 +9,11 @@ cat $urls_filename | while read line; do
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$filename" == "." ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "$filename does not exist"
|
||||
|
||||
sed -i "/$filename/d" $urls_filename
|
||||
sed -i "/$filename/d" "$urls_filename"
|
||||
done
|
||||
|
||||
|
||||
@@ -5,17 +5,20 @@ if [ "$(pwd)" == "$HOME" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mapfile -t files < <(find . -maxdepth 1 -type f -not -name 'desktop.ini')
|
||||
mapfile -t files < <(find . -type f -not -name 'urls.txt' -not -name 'desktop.ini')
|
||||
|
||||
for filename in "${files[@]}"; do
|
||||
filename_m5sum=$(md5sum "$filename" | awk '{print $1}')
|
||||
for filepath in "${files[@]}"; do
|
||||
filename=$(basename "$filepath")
|
||||
filename_dir=$(dirname "$filepath")
|
||||
|
||||
filename_md5sum=$(md5sum "$filepath" | awk '{print $1}')
|
||||
filename_extension="${filename##*.}"
|
||||
|
||||
new_filename="$filename_m5sum.$filename_extension"
|
||||
new_filename="$filename_md5sum.$filename_extension"
|
||||
|
||||
if [ "$filename" == "$new_filename" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
mv "$filename" "$new_filename"
|
||||
mv "$filepath" "$filename_dir/$new_filename"
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user