aboutsummaryrefslogtreecommitdiff
path: root/send-refresh.sh
diff options
context:
space:
mode:
authorSanJacobs2022-10-09 19:29:25 +0200
committerSanJacobs2022-10-09 19:29:25 +0200
commitac1a7b3cce0aaee69268f76a3c7bbf65fa7c4182 (patch)
treeecb6fc9ff6ebc325a83789db6ce9b302b93891cb /send-refresh.sh
parente5acf314d6109df29952770c26dcd12ba281807a (diff)
downloadsend-ac1a7b3cce0aaee69268f76a3c7bbf65fa7c4182.tar.gz
send-ac1a7b3cce0aaee69268f76a3c7bbf65fa7c4182.tar.bz2
send-ac1a7b3cce0aaee69268f76a3c7bbf65fa7c4182.zip
Cleanup, simplification, spaced path proofing
Diffstat (limited to 'send-refresh.sh')
-rwxr-xr-xsend-refresh.sh27
1 files changed, 10 insertions, 17 deletions
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 \<h2\>\<a href="$filename"\>$filename\</a\>\</h2\> >> $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 \<h2\>\<a href="$filename"\>$filename\</a\>\</h2\> >> "$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