From 0cd53bdd38c6fcc6e5ef5ed600c2fdd33f77e7dc Mon Sep 17 00:00:00 2001 From: "Scott C. MacCallum" Date: Thu, 2 Mar 2023 21:05:39 +0000 Subject: [PATCH] Added HTML month posts reference from finger --- cluster-to-other.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cluster-to-other.sh b/cluster-to-other.sh index 63bb281..5f4bf6c 100755 --- a/cluster-to-other.sh +++ b/cluster-to-other.sh @@ -20,6 +20,7 @@ # along with this program. If not, see . month=$(date '+%m') +let prevmonth=$month-1 year=$(date '+%Y') # Change this to the first letter of your login name letter="s" @@ -48,6 +49,13 @@ finger() # Remove the control characters from the $month-e01 file and write it as $month-e02 cat /sdf/arpa/ns/$letter/$USER/finger/$month-e01 | col -b -x > /sdf/arpa/ns/$letter/$USER/finger/$month-e02 + # Remove the HTML link reference to previous month posts + if [ $prevmonth -lt 10 ]; then + sed -i "s/0$prevmonth//" /sdf/arpa/ns/$letter/$USER/finger/$month-e02 + else + sed -i "s/$prevmonth//" /sdf/arpa/ns/$letter/$USER/finger/$month-e02 + fi + # Write a header file from index-e02 head -n 5 /sdf/arpa/ns/$letter/$USER/finger/index-e02 > /sdf/arpa/ns/$letter/$USER/finger/header @@ -99,7 +107,7 @@ gopher() # From the index-e02 file write the index cp /sdf/arpa/ns/$letter/$USER/gopher-prep/index-e02 /ftp/pub/users/$USER/index - # From the $month-e02 file write the month + # From the $month-e02 file write the $month cp /sdf/arpa/ns/$letter/$USER/gopher-prep/$month-e02 /ftp/pub/users/$USER/posts/$year/$month chmod -R 754 /ftp/pub/users/$USER