Updated formatting & removed redundancies

This commit is contained in:
bender
2023-02-02 18:16:32 -05:00
parent 1d58b6f50f
commit 48fe05290a
10 changed files with 112 additions and 93 deletions
+12 -4
View File
@@ -1,4 +1,10 @@
#This officially works for the full ODM extraction as of 1/21/23 at 9:54pm
#!/bin/bash
#This is a Frankenstein version of chbrowns overdrive script
#
#It extracts the contents of the odm into a temp directory so as to point the metadata
#file to the export path of the contents of the odm and then deletes the leftover files
source config.env
folder=$queue
@@ -6,7 +12,7 @@ annex=$annex
for file in $folder/*.odm
do
# Make temp dir in loop so that it clears even if there's any errors
#Make temp dir in loop so that it clears even if theres any errors
temp_dir=$(mktemp -d)
cd "$temp_dir"
@@ -20,20 +26,22 @@ do
sleep 2 # wait for 2 seconds before retrying
done
# Get the name of the downloaded folder
#Get the name of the downloaded folder
downloaded_folder=$(find "$temp_dir" -type d -mindepth 1 -maxdepth 1 | head -n 1)
echo "downloaded_folder: $downloaded_folder"
# Move the downloaded folder to the destination
#Move the downloaded folder to the destination
mv "$downloaded_folder" "$annex"
#Move the .odm.metadata to the downloaded folder
metadata_file=$(find "$folder" -name "*.odm.metadata")
mv "$metadata_file" "$annex/$(basename "$downloaded_folder")"
#Remove temp directory
rm -rf "$temp_dir"
done
#Remove .odm & .odm.license files
rm $queue/*.odm
rm $queue/*.odm.license