From efb35cd9c45a06810bfe574209e8d9482271176f Mon Sep 17 00:00:00 2001 From: FailedProxy Date: Mon, 23 Mar 2026 23:10:03 +0000 Subject: [PATCH] Updated info in all scripts --- Master.conf | 35 +++++++++++++++++------------- Rsync/rsync.sh | 8 ++++--- Rsync/user_script_pluin.sh | 4 +++- common.sh | 15 ++++++++++++- unRAID Essentials/server-reboot.sh | 9 ++++---- 5 files changed, 47 insertions(+), 24 deletions(-) diff --git a/Master.conf b/Master.conf index a887fc0..7cd568c 100644 --- a/Master.conf +++ b/Master.conf @@ -1,12 +1,22 @@ #!/bin/bash -################################################################################################## -############################## Master Variables for unRAID scripts ################################ -################################################################################################## - #----------------------------------------------------------------------------------------------- -#----------------------------- Host and Remote Detection --------------------------------------- +#----------------------------- Master Variables for unRAID scripts ----------------------------- +#----------------------------------------------------------------------------------------------- +#----------------- User Variables, Please adjust here in Master.conf as needed ----------------- +#----------------------------------------------------------------------------------------------- +# This is the master.conf file, it contains all the variables used by +# all scripts. It is sourced by each script at runtime, so any changes here will +# affect all scripts immediately. This is where you should adjust any settings or variables +# that you want to apply globally across all your scripts +# +#This allows for one centralized location for all your configurations, making it easier to manage +# and maintain your scripts. You can adjust the variables below as needed. +# +#----------------------------------------------------------------------------------------------- +#---------------End Of User Variables, Please adjust here in Master.conf as needed ------------- #----------------------------------------------------------------------------------------------- +# Host and Remote Detection # Define the hostnames of both servers HOST1="unRAID-Gmer4Lfe" HOST2="unRAID-Jayred365" @@ -25,9 +35,8 @@ fi echo "Local server: $LOCAL_SERVER_NAME" echo "Remote server: $REMOTE_SERVER_NAME" -#----------------------------------------------------------------------------------------------- -#--------------------------- Remote Server Ip Resolution ---------------------------------------- -#----------------------------------------------------------------------------------------------- + +# Remote Server Ip Resolution # Resolve Tailscale IP dynamically REMOTE_SERVER=$(tailscale ip -4 "$REMOTE_SERVER_NAME" 2>/dev/null) if [[ -z "$REMOTE_SERVER" ]]; then @@ -35,11 +44,8 @@ if [[ -z "$REMOTE_SERVER" ]]; then exit 1 fi -#----------------------------------------------------------------------------------------------- -#----------------------------- SSH Key Mapping -------------------------------------------------- -#----------------------------------------------------------------------------------------------- -declare -A SSH_KEYS +# SSH Key Mapping SSH_KEYS["$HOST1|$HOST2"]="/root/.ssh/Gmer4Lfe-rsync-key" SSH_KEYS["$HOST2|$HOST1"]="/root/.ssh/Jayred365-rsync-key" @@ -73,9 +79,8 @@ DELAYED_CONTAINERS=("") CONTAINER_DELAY=5 # Not include logs during transfer EXCLUDE_DIRS=("") -#----------------------------------------------------------------------------------------------- -#----------------------------- Profile System --------------------------------------------------- -#----------------------------------------------------------------------------------------------- +# +# Profile System # Profiles are inferred from the directory basename (lowercased) # Max rsync processes per profile diff --git a/Rsync/rsync.sh b/Rsync/rsync.sh index 729e7c9..5594735 100644 --- a/Rsync/rsync.sh +++ b/Rsync/rsync.sh @@ -1,11 +1,14 @@ #!/bin/bash set -e + +#----------------------------------------------------------------------------------------------- +# --------------------------- Core Rsync Script for Unraid ------------------------------------- #----------------------------------------------------------------------------------------------- #----------------- User Variables, Please adjust in Master.conf as needed ---------------------- #----------------------------------------------------------------------------------------------- -# This is the main Core Rsync script # # User variables can be adjusted in Master.conf +# # Scripts now just contain runtime logic # # This new setup allows for profiles and arguments to use the core script @@ -15,9 +18,8 @@ set -e # /mnt/user/appdata-test/Arrs/ is the argument # If the last name /Arrs/ matches a profile in Master.conf, then profile defaults are used # Otherwise, global configuration in Master.conf is used -# #----------------------------------------------------------------------------------------------- -#---------------End Of User Variables ---------------------------------------------------------- +#---------------End Of User Variables, Please adjust in Master.conf as needed ------------------ #----------------------------------------------------------------------------------------------- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" diff --git a/Rsync/user_script_pluin.sh b/Rsync/user_script_pluin.sh index 6519636..8567452 100644 --- a/Rsync/user_script_pluin.sh +++ b/Rsync/user_script_pluin.sh @@ -49,4 +49,6 @@ # #Examples #/mnt/user/appdata/unraid_scripts/Rsync/rsync.sh /mnt/user/appdata-test/Arrs/ MAX_RSYNC_PROCS=2 -#/mnt/user/appdata/unraid_scripts/Rsync/rsync.sh /mnt/user/appdata-test/Arrs/ --dry-run MAX_RSYNC_PROCS=2 \ No newline at end of file +#/mnt/user/appdata/unraid_scripts/Rsync/rsync.sh /mnt/user/appdata-test/Arrs/ --dry-run MAX_RSYNC_PROCS=2 +# +# Copy and paste into unRAID User Script plugin \ No newline at end of file diff --git a/common.sh b/common.sh index 4733399..ccaaf60 100644 --- a/common.sh +++ b/common.sh @@ -1,7 +1,20 @@ #!/bin/bash #----------------------------------------------------------------------------------------------- -# Common Shared Functions for Unraid Scripts +# --------------------- Common Shared Functions for Unraid Scripts ----------------------------- +#----------------------------------------------------------------------------------------------- +#----------------- User Variables, Please adjust in Master.conf as needed ---------------------- +#----------------------------------------------------------------------------------------------- +# +# Nothing to adjust here, all user variables should be in Master.conf +# +# This is just a script that has all common functions and logic that are shared +# between the different scripts. +# +# This way we can avoid code duplication and have a single source +# of truth for all common functions and logic. +#----------------------------------------------------------------------------------------------- +#---------------End Of User Variables, Please adjust in Master.conf as needed ------------------ #----------------------------------------------------------------------------------------------- # Load Master.conf relative to calling script diff --git a/unRAID Essentials/server-reboot.sh b/unRAID Essentials/server-reboot.sh index 38f43f8..e162976 100644 --- a/unRAID Essentials/server-reboot.sh +++ b/unRAID Essentials/server-reboot.sh @@ -1,20 +1,21 @@ #!/bin/bash +#----------------------------------------------------------------------------------------------- +# ---------------------------- Unattended Reboot Script for Unraid ----------------------------- #----------------------------------------------------------------------------------------------- #----------------- User Variables, Please adjust in Master.conf as needed ---------------------- #----------------------------------------------------------------------------------------------- -# This is the Unattended Reboot Script for Unraid # # User variables can be adjusted in Master.conf # This script is using the SLEEP Variable from Master.conf for the delay before reboot # +# Scripts now just contain runtime logic +# # This new setup allows for profiles and arguments to use the core script # Use arguments in unRAID User Plugin for directory # Example: /mnt/user/appdata/unraid_scripts/Rsync/rsync.sh --dry-run -# -#----------------------------------------------------------------------------------------------- -#---------------End Of User Variables ---------------------------------------------------------- #----------------------------------------------------------------------------------------------- +#---------------End Of User Variables, Please adjust in Master.conf as needed ------------------ #----------------------------------------------------------------------------------------------- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"