new storage log cron, discord now supports newlines, etc.
This commit is contained in:
@@ -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>"
|
||||
|
||||
Executable
+11
@@ -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
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user