Many changes

This commit is contained in:
Scott C. MacCallum 2025-02-19 16:51:29 +00:00
parent 2ee105cb5d
commit 5a17c30304

View File

@ -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/^$/<br>/' $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