#/bin/bash month=$(date '+%m') year=$(date '+%Y') # # Finger # # # Gopher # gemini() { # Download the index.html and month.html files sftp scm@ma.sdf.org:/meta/s/scm/html/index.html /sdf/arpa/ns/s/scm/gemini sftp scm@ma.sdf.org:/meta/s/scm/html/posts/$year/$month.html /sdf/arpa/ns/s/scm/gemini # Convert the index.html file to an index-e01 text file html2text -o /sdf/arpa/ns/s/scm/gemini/index-e01 -ascii -style pretty /sdf/arpa/ns/s/scm/gemini/index.html # Convert the month.html file to a month-e01 text file html2text -o /sdf/arpa/ns/s/scm/gemini/$month-e01 -ascii -style pretty /sdf/arpa/ns/s/scm/gemini/$month.html # Remove the blank lines from the beginning of the index-e01 file sed -i "1d;2d;3d" /sdf/arpa/ns/s/scm/gemini/index-e01 # Remove the blank lines from the beginning of the month-e01 file sed -i "1d;2d;3d" /sdf/arpa/ns/s/scm/gemini/$month-e01 # Remove the control characters from the index-e01 file and write it as index-e02 cat /sdf/arpa/ns/s/scm/gemini/index-e01 | col -b -x > /sdf/arpa/ns/s/scm/gemini/index-e02 # Remove the control characters from the month-e01 file and write it as month-e02 cat /sdf/arpa/ns/s/scm/gemini/$month-e01 | col -b -x > /sdf/arpa/ns/s/scm/gemini/$month-e02 } gemini # Write the head.gmi text file from the index.gmi text file # The number determines which lines are written #head -n 5 /sdf/arpa/ns/s/scm/gemini/index-gmi > /sdf/arpa/ns/s/scm/gemini/header.gmi # Write the footer.gmi text file from the index.gmi text file #tail -n 15 /sdf/arpa/ns/s/scm/gemini/index-gmi > /sdf/arpa/ns/s/scm/gemini/footer.gmi # Write the index.gmi text file from the header.gmi and footer.gmi text files #cat /sdf/arpa/ns/s/scm/gemini/header.gmi > /sdf/arpa/ns/s/scm/gemini/index.gmi #cat /sdf/arpa/ns/s/scm/gemini/footer.gmi >> /sdf/arpa/ns/s/scm/gemini/index.gmi # # Remove the posts header line from the index.html file # sed -i 's/