sdf/cluster-web-to-other.ksh

68 lines
1.8 KiB
Bash
Executable File

#/bin/ksh
#
# Cluster
#
# 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
wget -O /sdf/arpa/ns/s/scm/02.html https://scm.sdf.org/posts/2023/02.html
# Remove the posts lines
sed -i 's:<h3>Posts<\/h3>::' /sdf/arpa/ns/s/scm/index.html
sed -i 's:<h4><a href="https\:\/\/scm.sdf.org\/posts\/2023\/02.html">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 02.html file to a 02 text file
html2text -o /sdf/arpa/ns/s/scm/02 -ascii -style pretty /sdf/arpa/ns/s/scm/02.html
# Write the .plan text file from the index text file
cat /sdf/arpa/ns/s/scm/index > .plan
# Write the index text file to the root of Gopher
cp /sdf/arpa/ns/s/scm/index /ftp/pub/users/scm
# Write the 02 text file to the posts Gopher location
cp /sdf/arpa/ns/s/scm/02 /ftp/pub/users/scm/posts/2023
chmod -R 754 /ftp/pub/users/scm
#
# Meta Array
#
# Remove all control chracters 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 chracters from the 02 text file and write it to the 02.ma text file
cat /sdf/arpa/ns/s/scm/02 | col -b -x > /sdf/arpa/ns/s/scm/02.ma
# Write the index.ma 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
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
scp /sdf/arpa/ns/s/scm/02.ma scm@ma.sdf.org:/meta/gemini/scm/posts/2023/02.gmi
exit 0