reconf the master and common scripts and all unraid essential scripts# Please enter the commit message for your changes. Lines starting

This commit is contained in:
2026-03-24 00:28:11 +00:00
parent efb35cd9c4
commit 9300ae11c2
10 changed files with 454 additions and 90 deletions
+44
View File
@@ -0,0 +1,44 @@
#!/bin/bash
set -e
#-----------------------------------------------------------------------------------------------
# Stop all running User Scripts spawned by the User Scripts plugin
#-----------------------------------------------------------------------------------------------
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../common.sh"
# Load central config
load_master_conf
# Parse CLI args (supports --dry-run)
parse_args "$@"
# Functions
stop_user_scripts() {
# Get PIDs of running user scripts
local pids
pids=$(/usr/bin/ps -eo pid,cmd | grep "/tmp/user.scripts" | grep -v grep | awk '{print $1}')
if [ -z "$pids" ]; then
echo "No running user scripts found."
return
fi
for pid in $pids; do
if [ "$DRY_RUN" = true ]; then
echo "[DRY-RUN] Would kill user script with PID $pid"
else
echo "Killing user script with PID $pid"
kill "$pid"
fi
done
echo "All user scripts stopped."
}
# MAIN
echo "==== User Scripts Stop Script Started: $(date) ===="
stop_user_scripts