discord and thermal (pi specific) added, discord needs config setup.
This commit is contained in:
@@ -1 +1,2 @@
|
||||
/log/singleton.log
|
||||
/config.sh
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
DISCORD_GENERAL_HOOK="<WEBHOOK_URL_HERE>"
|
||||
|
||||
DISCORD_THERMAL_HOOK="<WEBHOOK_URL_HERE>"
|
||||
|
||||
DISCORD_STORAGE_HOOK="<WEBHOOK_URL_HERE>"
|
||||
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
source config.sh
|
||||
|
||||
HOOK_ARG="$1"
|
||||
MESSAGE="${@:2}"
|
||||
HOOK="general"
|
||||
HOOK_URL=$DISCORD_GENERAL_HOOK
|
||||
|
||||
case $HOOK_ARG in
|
||||
thermal)
|
||||
HOOK="thermal"
|
||||
HOOK_URL=$DISCORD_THERMAL_HOOK
|
||||
;;
|
||||
storage)
|
||||
HOOK="storage"
|
||||
HOOK_URL=$DISCORD_STORAGE_HOOK
|
||||
;;
|
||||
esac
|
||||
|
||||
curl -s -H "Content-Type: application/json" -X POST -d "{\"content\": \"${MESSAGE}\"}" $HOOK_URL | jq -r '.id'
|
||||
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
name=$(</sys/class/thermal/thermal_zone0/type)
|
||||
temp=$(</sys/class/thermal/thermal_zone0/temp)
|
||||
echo "${name} $((temp/1000)).$((temp%1000))c"
|
||||
|
||||
Reference in New Issue
Block a user