From ac1a7b3cce0aaee69268f76a3c7bbf65fa7c4182 Mon Sep 17 00:00:00 2001 From: SanJacobs Date: Sun, 9 Oct 2022 19:29:25 +0200 Subject: Cleanup, simplification, spaced path proofing --- send-refresh.sh | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'send-refresh.sh') diff --git a/send-refresh.sh b/send-refresh.sh index 3df4a51..20d9f12 100755 --- a/send-refresh.sh +++ b/send-refresh.sh @@ -19,18 +19,18 @@ echo " --- Young files ---" for file in "${young_files[@]}"; do filename=$(basename "$file") checksum=$(md5sum "$file" | awk '{print $1;}') - filesite=$webdir$checksum + filesite="$webdir$checksum" if mkdir "$filesite" ; then echo "Made directory, and it worked!" - webpage=$filesite/index.html - cat html/1.part >> $webpage - echo \\$filename\\ >> $webpage - cat html/2.part >> $webpage - stat $file >> $webpage - zipinfo -1 $file | tree --fromfile . >> $webpage - cat html/3.part >> $webpage + webpage="$filesite/index.html" + cat html/1.part >> "$webpage" + echo \\$filename\\ >> "$webpage" + cat html/2.part >> "$webpage" + stat "$file" >> "$webpage" + zipinfo -1 "$file" | tree --fromfile . >> "$webpage" + cat html/3.part >> "$webpage" mv "$file" "$filesite/$filename" @@ -45,15 +45,8 @@ for file in "${young_files[@]}"; do done -echo "\n --- Old files ---" +echo " --- Old files ---" for file in "${old_files[@]}"; do - filename=$(basename "$file") - checksum=$(md5sum "$file" | awk '{print $1;}') - echo "file: $file" - echo "filename: $filename" - echo "checksum: $checksum" - - rm -rf $(dirname "$file") - + rm -rf "$(dirname "$file")" done -- cgit v1.2.1