From c017cb18f9509c0fc693a85059d014ba514e5b11 Mon Sep 17 00:00:00 2001 From: "Scott C. MacCallum" Date: Sun, 26 Feb 2023 19:44:41 +0000 Subject: [PATCH] Added footer from index --- cluster-web-to-other.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/cluster-web-to-other.sh b/cluster-web-to-other.sh index 6f75580..057e78c 100755 --- a/cluster-web-to-other.sh +++ b/cluster-web-to-other.sh @@ -15,14 +15,6 @@ wget -O /sdf/arpa/ns/s/scm/index.html https://scm.sdf.org wget -O /sdf/arpa/ns/s/scm/$month.html https://scm.sdf.org/posts/$year/$month.html -# Remove the posts header line from the index HTML file - -sed -i 's/

Posts<\/h3>//' /sdf/arpa/ns/s/scm/index.html - -# Remove the posts lines from the index HTML file - -sed -i "s/

{$year}<\/a><\/h4>//" /sdf/arpa/ns/s/scm/index.html - # Convert the index HTML file to an index text file html2text -o /sdf/arpa/ns/s/scm/index -ascii -style pretty /sdf/arpa/ns/s/scm/index.html @@ -31,6 +23,18 @@ html2text -o /sdf/arpa/ns/s/scm/index -ascii -style pretty /sdf/arpa/ns/s/scm/in html2text -o /sdf/arpa/ns/s/scm/$month -ascii -style pretty /sdf/arpa/ns/s/scm/$month.html +# Write the footer text file from the index text file + +tail -n 15 /sdf/arpa/ns/s/scm/index > footer + +# Remove the posts header line from the index HTML file + +sed -i 's/

Posts<\/h3>//' /sdf/arpa/ns/s/scm/index.html + +# Remove the posts lines from the index HTML file + +sed -i "s/

{$year}<\/a><\/h4>//" /sdf/arpa/ns/s/scm/index.html + # Remove the blank lines from the beginning of the index file sed -i '1d;2d;3d' /sdf/arpa/ns/s/scm/index