Skip to content

Instantly share code, notes, and snippets.

View evenwebb's full-sized avatar
👨‍💻

Steven evenwebb

👨‍💻
  • Cornwall, UK
  • 09:25 (UTC +01:00)
View GitHub Profile
@evenwebb
evenwebb / download-folder-cleanup.sh
Created September 4, 2025 09:40
This script clears a specified download folder, records how many files and how much total data were deleted, and sends a summary notification via Pushover. It’s useful for keeping download directories clean, freeing up disk space, and staying informed with automatic alerts after each cleanup.
#!/bin/bash
# Store the directory path in a variable for easy modification
dir_path="/mnt/user/Downloads/"
# Count the number of files and directories in the directory
file_count=$(find "$dir_path" -mindepth 1 | wc -l)
# Get the total size of all files in the directory
total_size=$(du -sh "$dir_path" | awk '{print $1}')
@evenwebb
evenwebb / plex-docker-watchdog.sh
Created September 4, 2025 09:38
This script monitors a Plex Docker container and automatically restarts it if the Plex web UI becomes unresponsive. If the UI is unreachable, the script restarts the container and sends a Pushover notification to alert you.
#!/bin/bash
# Pushover configuration
PUSHOVER_USER_KEY="00000000000000000000000"
PUSHOVER_APP_TOKEN="000000000000000"
# Docker container name for Plex
PLEX_CONTAINER_NAME="plex"
# Plex web UI URL
@evenwebb
evenwebb / RadarrProfileAutoUpdater.sh
Created September 4, 2025 09:35
This script automates Radarr quality profile management by ensuring movies from the current year are assigned to a dedicated profile while reverting previous year’s titles back to a default profile.
#!/bin/bash
RADARR_URL="http://192.168.1.1:7878"
API_KEY="234234234234234234234234234234234234234"
CURRENT_YEAR_PROFILE_ID=9
DEFAULT_PROFILE_ID=2
DRY_RUN=0 # 1 = dry run, 0 = live
THIS_YEAR=$(date +"%Y")
@evenwebb
evenwebb / plexcheck.sh
Created April 12, 2018 17:02
Check Plex Server Status
#!/bin/bash
#name=Plex Media Server check and restart
#description=This script will restart PLEX if it does not respond after two attempts.
#arrayStarted=true
dockerid=$(docker ps -aqf "name=Plex")
if [ "$dockerid" == "" ]; then
echo "ERR $(date -Is) - Could not get a docker id for docker name \"Plex\"."
exit 1;
fi
@evenwebb
evenwebb / PhotoImport.sh
Last active September 4, 2025 10:59 — forked from ljm42/PhotoImport.sh
Automatically imports photos and videos from camera memory cards to your unRAID server when inserted via USB. Updated for unRAID OS 7.0+ with enhanced error handling, modern camera support, and improved notifications.
#!/bin/bash
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
## Modern Photo Import Script for unRAID 7.x
## Updated for unRAID OS 7.0+ with improved error handling and modern features
##
## Usage (after configuration):
## 1. Insert camera's memory card into a USB port on your unRAID system
## 2. The system will automatically move (or copy) any images/videos from the memory card to the array
## Photos will be auto-rotated based on EXIF data if tools are available