new storage log cron, discord now supports newlines, etc.

This commit is contained in:
2020-04-23 14:52:30 +00:00
parent 81044e696b
commit 4f80e34663
3 changed files with 17 additions and 2 deletions
+4
View File
@@ -3,6 +3,10 @@
# degrees in C
THERMAL_ALERT=75
STORAGE_MONITOR=("/")
SERVER_DOMAIN="localhost"
DISCORD_SERVER_NAME="<YOUR SERVER>"
DISCORD_GENERAL_HOOK="<WEBHOOK_URL_HERE>"
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
LOCATION=`dirname "$0"`
source "${LOCATION}/../config.sh"
storage=`${LOCATION}/../df-custom.sh ${STORAGE_MONITOR[@]}`
echo "${storage}"
${LOCATION}/../discord.sh storage "${storage}"
+2 -2
View File
@@ -5,7 +5,7 @@ LOCATION=`dirname "$0"`
source "${LOCATION}/config.sh"
HOOK_ARG="$1"
MESSAGE="${@:2}"
MESSAGE=`echo "${@:2}" | jq -aRs .`
HOOK="general"
HOOK_URL=$DISCORD_GENERAL_HOOK
@@ -20,5 +20,5 @@ case $HOOK_ARG in
;;
esac
curl -s -H "Content-Type: application/json" -X POST -d "{\"username\": \"${DISCORD_SERVER_NAME}\", \"content\": \"${MESSAGE}\"}" $HOOK_URL | jq -r '.id'
curl -s -H "Content-Type: application/json" -X POST -d "{\"username\": \"${DISCORD_SERVER_NAME}\", \"content\": ${MESSAGE}}" $HOOK_URL | jq -r '.id'