From 0801853077a908b3118ab6611eb155d0628b922e Mon Sep 17 00:00:00 2001 From: Michael Bell Date: Wed, 26 Nov 2025 20:46:32 +1000 Subject: [PATCH] docs(bots): Simplify variable handling Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com> Signed-off-by: Michael Bell --- docs/bots.md | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/docs/bots.md b/docs/bots.md index 0883156704..83d01b0d92 100644 --- a/docs/bots.md +++ b/docs/bots.md @@ -335,32 +335,10 @@ Bots can also send message. On the sending process the same signature/verificati ```bash #!/bin/bash -# Required environment variables: -# NC_URL: The URL of the Nextcloud instance (e.g., "https://nextcloud.example.com") -# TOKEN: The token of the conversation -# SECRET: Shared secret that is specified when installing a bot -# MESSAGE: The message to be sent - -# Check if required variables are set -if [ -z "$NC_URL" ]; then - echo "Error: NC_URL is not set." - exit 1 -fi - -if [ -z "$TOKEN" ]; then - echo "Error: TOKEN is not set." - exit 1 -fi - -if [ -z "$SECRET" ]; then - echo "Error: SECRET is not set." - exit 1 -fi - -if [ -z "$MESSAGE" ]; then - echo "Error: MESSAGE is not set." - exit 1 -fi +NC_URL="https://nextcloud.example.tld/" # The URL of the Nextcloud instance (e.g., "https://nextcloud.example.com") +TOKEN="12345678" # The token of the conversation +SECRET="53CR3T" # Shared secret that is specified when installing a bot +MESSAGE=$1 # Pass the message as first argument # Generate a random header and signature RANDOM_HEADER=$(openssl rand -hex 32)