december-adventure-2024/gemini-server-test/cmd/run.sh

18 lines
417 B
Bash
Raw Normal View History

#!/bin/bash
case $1 in
"list")
echo "=> /create Create new entry"
cat /app/cmd/entries.log.gmi
;;
"create")
echo "" >> /app/cmd/entries.log.gmi
date=$(date -u +"%Y-%m-%d %H:%M %Z")
echo "## $date" >> /app/cmd/entries.log.gmi
while IFS= read -r line; do
echo $line >> /app/cmd/entries.log.gmi
done
echo "Entry created."
echo "=> / Back to the log entries"
;;
esac