sdf-scripts/cluster-web-to-other.ksh

80 lines
2.1 KiB
Bash
Raw Normal View History

2023-02-11 15:33:40 +00:00
#/bin/ksh
2023-02-14 22:52:30 +00:00
#
2023-02-13 19:54:06 +00:00
# Cluster
2023-02-14 22:52:30 +00:00
#
# Download the websites index.html file
2023-02-13 19:54:06 +00:00
2023-02-11 15:33:40 +00:00
wget -O /sdf/arpa/ns/s/scm/index.html https://scm.sdf.org
2023-02-14 22:52:30 +00:00
# Download the websites 02.html file
2023-02-14 19:26:18 +00:00
wget -O /sdf/arpa/ns/s/scm/02.html https://scm.sdf.org/posts/2023/02.html
2023-02-15 21:56:36 +00:00
# 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
2023-02-14 22:52:30 +00:00
# Convert the index.html file to an index text file
2023-02-14 18:52:55 +00:00
html2text -o /sdf/arpa/ns/s/scm/index -ascii -style pretty /sdf/arpa/ns/s/scm/index.html
2023-02-11 15:33:40 +00:00
2023-02-16 00:56:01 +00:00
# Convert the posts HTML file to a text file
2023-02-14 22:52:30 +00:00
2023-02-14 19:26:18 +00:00
html2text -o /sdf/arpa/ns/s/scm/02 -ascii -style pretty /sdf/arpa/ns/s/scm/02.html
2023-02-16 00:56:01 +00:00
# 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/02
2023-02-14 22:52:30 +00:00
# Write the .plan text file from the index text file
2023-02-14 18:52:55 +00:00
cat /sdf/arpa/ns/s/scm/index > .plan
2023-02-11 15:33:40 +00:00
2023-02-16 04:30:17 +00:00
# Write the posts to the .plan file
2023-02-16 00:56:01 +00:00
2023-02-14 22:52:30 +00:00
# Write the index text file to the root of Gopher
2023-02-14 23:35:14 +00:00
cp /sdf/arpa/ns/s/scm/index /ftp/pub/users/scm
2023-02-13 19:54:06 +00:00
2023-02-14 22:52:30 +00:00
# Write the 02 text file to the posts Gopher location
2023-02-14 19:26:18 +00:00
2023-02-14 23:35:14 +00:00
cp /sdf/arpa/ns/s/scm/02 /ftp/pub/users/scm/posts/2023
2023-02-16 00:56:01 +00:00
# Set the proper Gopher directory permissions
2023-02-14 23:35:14 +00:00
chmod -R 754 /ftp/pub/users/scm
2023-02-14 19:37:49 +00:00
2023-02-14 22:52:30 +00:00
#
2023-02-13 19:54:06 +00:00
# Meta Array
2023-02-14 22:52:30 +00:00
#
2023-02-16 00:59:58 +00:00
# Remove all control characters from the index text file and write it to the index.ma text file
2023-02-13 19:54:06 +00:00
2023-02-14 19:06:07 +00:00
cat /sdf/arpa/ns/s/scm/index | col -b -x > /sdf/arpa/ns/s/scm/index.ma
2023-02-13 19:54:06 +00:00
2023-02-16 00:59:58 +00:00
# Remove all the control characters from the 02 text file and write it to the 02.ma text file
2023-02-14 22:52:30 +00:00
2023-02-14 21:44:59 +00:00
cat /sdf/arpa/ns/s/scm/02 | col -b -x > /sdf/arpa/ns/s/scm/02.ma
2023-02-14 22:52:30 +00:00
# Write the index.ma text file to the .plan text file
2023-02-14 18:52:55 +00:00
scp /sdf/arpa/ns/s/scm/index.ma scm@ma.sdf.org:/meta/s/scm/.plan
2023-02-13 19:54:06 +00:00
2023-02-14 22:52:30 +00:00
# Write the index.ma text file to the index.gmi text file to the root of Gemini
2023-02-14 18:52:55 +00:00
scp /sdf/arpa/ns/s/scm/index.ma scm@ma.sdf.org:/meta/gemini/scm/index.gmi
2023-02-13 19:54:06 +00:00
2023-02-14 22:52:30 +00:00
# Write the 02.ma text file to the 02.gmi text file to the posts location on Gemini
2023-02-14 21:51:31 +00:00
scp /sdf/arpa/ns/s/scm/02.ma scm@ma.sdf.org:/meta/gemini/scm/posts/2023/02.gmi
2023-02-14 21:44:59 +00:00
2023-02-11 15:33:40 +00:00
exit 0