diff --git a/cluster-web-to-other.ksh b/cluster-web-to-other.ksh index 4077894..6263312 100755 --- a/cluster-web-to-other.ksh +++ b/cluster-web-to-other.ksh @@ -1,30 +1,33 @@ #/bin/ksh +month=$(date '+%m') +year=$(date '+%Y') + # # Cluster # -# Download the websites index.html file +# Download the websites index HTML file wget -O /sdf/arpa/ns/s/scm/index.html https://scm.sdf.org -# Download the websites 02.html file +# Download the websites posts HTML file wget -O /sdf/arpa/ns/s/scm/02.html https://scm.sdf.org/posts/2023/02.html -# Remove the posts lines +# Remove the post related lines from the index HTML file sed -i 's:

Posts<\/h3>::' /sdf/arpa/ns/s/scm/index.html sed -i 's:

2023<\/a><\/h4>::' /sdf/arpa/ns/s/scm/index.html -# Convert the index.html file to an index text file +# 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 # Convert the posts HTML file to a text file -html2text -o /sdf/arpa/ns/s/scm/02 -ascii -style pretty /sdf/arpa/ns/s/scm/02.html +html2text -o /sdf/arpa/ns/s/scm/$month -ascii -style pretty /sdf/arpa/ns/s/scm/$month.html # Remove the blank lines from the beginning of the index file @@ -34,19 +37,19 @@ sed -i '1d;2d;3d' /sdf/arpa/ns/s/scm/index sed -i '1d;2d;3d' /sdf/arpa/ns/s/scm/02 -# Write the .plan text file from the index text file +# Write the index text file to the .plan text file cat /sdf/arpa/ns/s/scm/index > .plan -# Write the posts to the .plan file +# Write the posts text file to the .plan cluster text file -# Write the index text file to the root of Gopher +# Write the index text file to the root Gopher location cp /sdf/arpa/ns/s/scm/index /ftp/pub/users/scm -# Write the 02 text file to the posts Gopher location +# Write the posts text file to the posts Gopher location -cp /sdf/arpa/ns/s/scm/02 /ftp/pub/users/scm/posts/2023 +cp /sdf/arpa/ns/s/scm/$month /ftp/pub/users/scm/posts/2023 # Set the proper Gopher directory permissions @@ -56,24 +59,24 @@ chmod -R 754 /ftp/pub/users/scm # Meta Array # -# Remove all control characters from the index text file and write it to the index.ma text file +# Remove all control characters from the index text file and write it to the index MA text file cat /sdf/arpa/ns/s/scm/index | col -b -x > /sdf/arpa/ns/s/scm/index.ma -# Remove all the control characters from the 02 text file and write it to the 02.ma text file +# Remove all the control characters from the posts text file and write it to the MA text file -cat /sdf/arpa/ns/s/scm/02 | col -b -x > /sdf/arpa/ns/s/scm/02.ma +cat /sdf/arpa/ns/s/scm/$month | col -b -x > /sdf/arpa/ns/s/scm/$month.ma -# Write the index.ma text file to the .plan text file +# Write the MA index text file to the .plan text file scp /sdf/arpa/ns/s/scm/index.ma scm@ma.sdf.org:/meta/s/scm/.plan -# Write the index.ma text file to the index.gmi text file to the root of Gemini +# Write the MA index text file to the Gemini index text file scp /sdf/arpa/ns/s/scm/index.ma scm@ma.sdf.org:/meta/gemini/scm/index.gmi -# Write the 02.ma text file to the 02.gmi text file to the posts location on Gemini +# Write the MA posts text file to the Gemini posts text file -scp /sdf/arpa/ns/s/scm/02.ma scm@ma.sdf.org:/meta/gemini/scm/posts/2023/02.gmi +scp /sdf/arpa/ns/s/scm/$month.ma scm@ma.sdf.org:/meta/gemini/scm/posts/$year/$month.gmi exit 0