Initial commit: Media Server Dashboard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Housemann
2026-07-11 05:40:27 +02:00
co-authored by Claude Sonnet 4.6
commit 02dec08748
8 changed files with 1239 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#!/bin/sh
MOUNT="/downloads"
OUTPUT="/html/disk.json"
update_disk() {
LINE=$(df -h "$MOUNT" 2>/dev/null | awk 'NR==2')
if [ -z "$LINE" ]; then
echo "ERROR: df failed for $MOUNT" >&2
return 1
fi
TOTAL=$(echo "$LINE" | awk '{print $2}')
USED=$(echo "$LINE" | awk '{print $3}')
AVAILABLE=$(echo "$LINE" | awk '{print $4}')
USE_PERCENT=$(echo "$LINE" | awk '{print $5}')
cat > "$OUTPUT" <<JSON
{
"total": "$TOTAL",
"used": "$USED",
"available": "$AVAILABLE",
"use_percent": "$USE_PERCENT",
"updated_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
}
JSON
echo "disk.json updated: $USE_PERCENT used ($USED / $TOTAL)"
}
while true; do
update_disk || true
sleep 30
done