wqebhooky
This commit is contained in:
+2
-7
@@ -2,18 +2,13 @@
|
|||||||
set -e # faiulure is not tolerated here
|
set -e # faiulure is not tolerated here
|
||||||
## easy to add ids~
|
## easy to add ids~
|
||||||
vendor_ids=('00:25:DF' '00:58:28' '00:C0:D4' '84:70:03')
|
vendor_ids=('00:25:DF' '00:58:28' '00:C0:D4' '84:70:03')
|
||||||
|
webhook_url="$(cat /home/princesspi/.discord_url)"
|
||||||
|
tag="$(cat /home/princesspi/.discord_tag)"
|
||||||
|
|
||||||
send_discord_webhook() {
|
send_discord_webhook() {
|
||||||
local username="DreamMaker"
|
local username="DreamMaker"
|
||||||
local webhook_url="${DISCORD_WEBHOOK_URL:-}"
|
|
||||||
local tag="${DISCORD_WEBHOOK_TAG:-}"
|
|
||||||
local message="$1 $tag"
|
local message="$1 $tag"
|
||||||
|
|
||||||
if [ -z "$webhook_url" ]; then
|
|
||||||
echo "DISCORD_WEBHOOK_URL ENVVAR is not set" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
curl -sS -X POST \
|
curl -sS -X POST \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"username\":\"${username}\",\"$message\":\"${message}\"}" \
|
-d "{\"username\":\"${username}\",\"$message\":\"${message}\"}" \
|
||||||
|
|||||||
Reference in New Issue
Block a user