adds new fortune

This commit is contained in:
James Tomasino 2023-05-15 20:08:46 +00:00
parent bd0d8ee5d9
commit bf5a45c9e4
2 changed files with 2 additions and 30 deletions

View File

@ -1,30 +0,0 @@
#!/usr/bin/env bash
run_user=$(id -un)
if [ "$run_user" = "gemini" ]; then
# clear
cd /var/gemini || return
rm -rf ./*
# copy gopher to start with all txt content
cp -R /var/gopher/* /var/gemini > /dev/null 2>&1
# generate index pages
# curl -s gopher://localhost | /var/cosmic/awk/gophermap2gemini.awk > /var/gemini/index.gmi
cp /var/cosmic/templates/geminiintro.tmpl /var/gemini/index.gmi
curl -s -N gopher://localhost/1/listing.gophermap | head -n 20 | /var/cosmic/awk/gophermap2gemini.awk >> /var/gemini/index.gmi
curl -s -N gopher://localhost/1/log | /var/cosmic/awk/gophermap2gemini.awk > /var/gemini/log/index.gmi
curl -s -N gopher://localhost/1/ships | /var/cosmic/awk/gophermap2gemini.awk > /var/gemini/ships/index.gmi
sed 's?gopher://cosmic.voyage/0/?gemini://cosmic.voyage/?' /var/gopher/rss.xml | sed 's?<link>gopher://cosmic.voyage?<link>gemini://cosmic.voyage?' > /var/gemini/rss.xml
sed 's?gopher://cosmic.voyage/0/?gemini://cosmic.voyage/?' /var/gopher/atom.xml | sed 's?<link>gopher://cosmic.voyage?<link>gemini://cosmic.voyage?' > /var/gemini/atom.xml
# create ship directories
find "/var/gopher/" -maxdepth 1 ! -path "/var/gopher/" ! -path "/var/gopher/ships" ! -path "/var/gopher/log" -type d | sed 's|/var/gopher/||' | sort | while read -r ship
do
curl -s -N "gopher://localhost/1/ships/${ship}" | /var/cosmic/awk/gophermap2gemini.awk > "/var/gemini/ships/${ship}/index.gmi"
done
# Let user's know it's done
printf "Gemini and gemini feeds rebuilt successfully.\\n"
else
exec sudo -u gemini "$0" "$@"
fi

2
files/fortunes/cosmic Normal file → Executable file
View File

@ -50,3 +50,5 @@ Remember, no matter where you go, there you are.
%
If it bleeds, we can kill it.
%
We are history, written red, the surface, white our bones on terraformed Mars - cradle of our children
%