#/bin/ksh month=$(date '+%m') year=$(date '+%Y') # # Cluster # # Download the websites index HTML file wget -O /sdf/arpa/ns/s/scm/index.html https://scm.sdf.org # Download the websites posts HTML file wget -O /sdf/arpa/ns/s/scm/$month.html https://scm.sdf.org/posts/$year/$month.html # Remove the post related lines from the index HTML file sed -i 's/

Posts<\/h3>//' /sdf/arpa/ns/s/scm/index.html # This line works as it is but ideally the year and month would use # variables. I don't know how to this yet and will move forward. sed -i 's/

2023<\/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 # Convert the posts HTML file to a text file 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 sed -i '1d;2d;3d' /sdf/arpa/ns/s/scm/index # Remove the blank lines from the beginning of the posts file sed -i '1d;2d;3d' /sdf/arpa/ns/s/scm/$month # Write the index text file to the .plan text file #cat /sdf/arpa/ns/s/scm/index > /sdf/arpa/ns/s/scm/.plan # Write the posts text file to the .plan cluster text file # Researching how best to do this yeilded a lot of interesing results. After # some thinking, I decided this was the best way, as it's readable and I # think will be easy to modify as needed head -n 5 index > /sdf/arpa/ns/s/scm/header cat /sdf/arpa/ns/s/scm/$month > body cat /sdf/arpa/ns/s/scm/header > .plan cat /sdf/arpa/ns/s/scm/body >> .plan cat /sdf/arpa/ns/s/scm/footer >> .plan # Write the index text file to the root Gopher location cp /sdf/arpa/ns/s/scm/index /ftp/pub/users/scm # Write the posts text file to the posts Gopher location cp /sdf/arpa/ns/s/scm/$month /ftp/pub/users/scm/posts/$year # Set the proper Gopher directory permissions 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 cat /sdf/arpa/ns/s/scm/index | col -b -x > /sdf/arpa/ns/s/scm/index.ma # Remove all the control characters from the posts text file and write it to the MA text file cat /sdf/arpa/ns/s/scm/$month | col -b -x > /sdf/arpa/ns/s/scm/$month.ma # 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 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 MA posts text file to the Gemini posts text file scp /sdf/arpa/ns/s/scm/$month.ma scm@ma.sdf.org:/meta/gemini/scm/posts/$year/$month.gmi exit 0