feat: rework entire file system (must change soon)

This commit is contained in:
2025-06-17 12:40:23 +02:00
parent 671daaa480
commit b06203a759
10 changed files with 242 additions and 238 deletions

19
scripts/disk-monitor.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
source /etc/serverconfig/.env
disk_usage() {
df -h / | grep / | awk -v max="$1" '{
usage = $5;
gsub("%", "", usage);
if (usage > max) {
printf "<b>🚨 WARNING:</b>\nDisk usage is at %d%%. which exceed the treshold of %d%%.\n\n", usage, max;
}
printf "<b>💾 Disk Usage Information:</b>\nTotal Size: %s, Used: %s, Available: %s\n\n", $2, $3, $4;
}'
}
curl -X POST "https://api.telegram.org/bot$TOKEN/sendMessage" \
-d "chat_id=$CHAT_ID" \
-d "text=$(disk_usage 80)" \
-d "parse_mode=HTML"