From 5a17c30304b9046efa783009ca510ec1b8111a9d Mon Sep 17 00:00:00 2001 From: "Scott C. MacCallum" Date: Wed, 19 Feb 2025 16:51:29 +0000 Subject: [PATCH] Many changes --- convert-website.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/convert-website.sh b/convert-website.sh index 5074a68..682b7c9 100755 --- a/convert-website.sh +++ b/convert-website.sh @@ -1,7 +1,7 @@ #!/usr/pkg/bin/bash # convert-website.sh -# This script is part of the website-to-other.sh project, which converts my +# This script is part of the website-to-other project, which converts my # website to other formats # Copyright (c) 2024, 2025, Scott C. MacCallum (scm@sdf.org). @@ -34,13 +34,13 @@ cp $WebDir/index.html $WebDir/index.html.old sed 's/^$/
/' $WebDir/index.html > $WebDir/index.html-01 # Convert the modified index.html file to an index.html text file -html2text -o $WebDir/index.html-02 $WebDir/index.html-01 +html2text -width 65 -o $WebDir/index.html-02 $WebDir/index.html-01 # Remove the control characters from the index.html text file cat $WebDir/index.html-02 | col -b -x > $WebDir/index.html-03 # Remove the blank lines from the top of the index.html text file -sed '1,12d' $WebDir/index.html-03 > $WebDir/index.html-04 +sed '1,7d' $WebDir/index.html-03 > $WebDir/index.html-04 # Write the show title to a new index.html text file cat $HOME/SCM-Show.txt > $WebDir/index.html-05 @@ -48,25 +48,28 @@ cat $HOME/SCM-Show.txt > $WebDir/index.html-05 # Append the previous index.html text file to the new index.html text file cat $WebDir/index.html-04 >> $WebDir/index.html-05 -# Write the Gopher index file from the index.html text file -cat $WebDir/index.html-05 > $GopherDir/index +# Remove the tabs from the index.html text file +tr -d '\t' < $WebDir/index.html-05 > $WebDir/index.html-06 -# Write the Gemini file index.gmi from the index.html text file -cat $WebDir/index.html-05 > $GopherDir/index.gmi +# Write a Gopher index text file from the index.html text file +cat $WebDir/index.html-06 > $GopherDir/index -# Write the cluster .plan file from the Gopher index file +# Write a Gemini index.gmi from the Gopher text file +cat $GopherDir/index > $GopherDir/index.gmi + +# Write a cluster .plan file from the Gopher index text file cat $GopherDir/index > $HOME/.plan # Write the MetaArray .plan file from the cluster .plan file scp $HOME/.plan scm@ma.sdf.org:/meta/s/scm/.plan -# Set the correct WWW permissions -mkhomepg -p +# Set the correct World Wide Web (WWW) permissions +chmod -R 751 /www/nz/s/scm # Set the correct Gopher and Gemini permissions chmod -R 754 $GopherDir -# Unless the debug option is invoked clean up the unneeded files +# Unless the debug option is invoked, clean up the unneeded files sh $HOME/website-to-other/cleanup.sh exit 0