Use CGI for Gemini and various style and syntax changes #3

Merged
ben merged 2 commits from :master into master 2020-05-26 23:13:04 +00:00
1 changed files with 7 additions and 7 deletions
Showing only changes of commit 5f93c05f07 - Show all commits

14
bb.sh
View File

@ -863,17 +863,17 @@ make_gophermap() {
ln -s "${HOME}/public_html/blog/" "${HOME}/public_gopher/blog" ln -s "${HOME}/public_html/blog/" "${HOME}/public_gopher/blog"
fi fi
if [ ! -f "${HOME}/public_gopher/blog/gophermap" ]; then if [ ! -f "${HOME}/public_gopher/blog/$gophermap" ]; then
cat <<- 'EOF' > $HOME/public_html/blog/gophermap cat <<- 'EOF' > $HOME/public_html/blog/$gophermap
#!/bin/bash #!/usr/bin/env sh
echo -e "my bashblog posts\n" printf "my bashblog posts\n"
user=$(stat -c '%U' .) user=$(stat -c '%U' .)
for post in $(ls -t *.md); do for post in $(ls -t *.md); do
post=$(basename $post) post=$(basename $post)
echo -e "0$post\t/~$user/blog/$post\ttilde.team\t70" printf "0$post\t/~$user/blog/$post\ttilde.team\t70\n"
done done
EOF EOF
chmod +x $HOME/public_html/blog/gophermap chmod +x $HOME/public_html/blog/$gophermap
fi fi
chmod 644 *.md chmod 644 *.md
} }
@ -890,7 +890,7 @@ make_gemini() {
if [ ! -f "${HOME}/public_gemini/blog/$gemini_index" ]; then if [ ! -f "${HOME}/public_gemini/blog/$gemini_index" ]; then
cat <<- 'EOF' > $HOME/public_gemini/blog/$gemini_index cat <<- 'EOF' > $HOME/public_gemini/blog/$gemini_index
#!/bin/bash #!/usr/bin/env sh
printf "20 text/gemini\r\n" printf "20 text/gemini\r\n"
printf "my bashblog posts\r\n" printf "my bashblog posts\r\n"
user=$(stat -c '%U' $0) user=$(stat -c '%U' $0)