refactor: Update getAJoke function to exclude offensive jokes

This commit is contained in:
Andras Bacsai
2024-09-19 12:50:51 +02:00
parent 6ec1b9b3f5
commit 91485b5d4d

View File

@@ -23,7 +23,7 @@ INSTALLATION_LOG_WITH_DATE="/data/coolify/source/installation-${DATE}.log"
exec > >(tee -a $INSTALLATION_LOG_WITH_DATE) 2>&1
getAJoke() {
JOKES=$(curl -s --max-time 2 https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true)
JOKES=$(curl -s --max-time 2 https://v2.jokeapi.dev/joke/Programming?blacklistFlags=nsfw,religious,political,racist,sexist,explicit&format=txt&type=single || true)
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"