From 4cfaf71b066c921fe8e63f0579de2e8a1b3d2c84 Mon Sep 17 00:00:00 2001 From: phil Date: Tue, 23 May 2023 19:23:39 +0100 Subject: [PATCH] Added Discord Webhook function --- check.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/check.sh b/check.sh index 3dea8de..91cd5bc 100644 --- a/check.sh +++ b/check.sh @@ -7,6 +7,9 @@ domains=$(cat /LOCATION/OF/domains.txt) sender_email="SENDER_NAME" receiver_email="RECEIVER_EMAIL" +# Discord Webhook +WEBHOOK_URL="WEBHOOK_URL" + # Initialize an empty array to store the expiring domains and their days left expiring_domains=() @@ -44,5 +47,8 @@ if [ ${#expiring_domains[@]} -gt 0 ]; then # Send the email echo -e "$body" | mail -s "$subject" -a "From: $sender_email" "$receiver_email" + + curl -H "Content-Type: application/json" -X POST --data "{\"content\": null, \"embeds\": [{\"title\": \"$subject\", \"description\": \"$body\", \"color\": null}], \"attachments\": []}" $WEBHOOK_URL + fi