initial commit

This commit is contained in:
2026-04-07 15:46:18 -04:00
commit bc1b1d1232
43 changed files with 1627 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
# Check GPU status in Jellyfin container
output=$(docker exec jellyfin nvidia-smi 2>&1)
exit_code=$?
# Log file location
LOG_FILE="/opt/docker/jellyfin/jellyfin-monitor.log"
# Check if command failed or output contains "error" (case insensitive)
if [ $exit_code -ne 0 ] || echo "$output" | grep -iq "error"; then
echo "$(date): GPU error detected." | tee -a "$LOG_FILE"
echo $output | tee -a "$LOG_FILE"
echo "$(date): Restarting Jellyfin..." | tee -a "$LOG_FILE"
cd /opt/docker/jellyfin/
docker compose restart
echo "$(date): Jellyfin restarted successfully" | tee -a "$LOG_FILE"
else
echo "$(date): GPU status OK"
fi