master config ssh variable addition
This commit is contained in:
+5
-4
@@ -22,7 +22,8 @@ HOST1="unRAID-Gmer4Lfe"
|
||||
HOST2="unRAID-Jayred365"
|
||||
|
||||
|
||||
|
||||
HOST1_SSH_KEY="/root/.ssh/Gmer4Lfe-rsync-key"
|
||||
HOST2_SSH_KEY="/root/.ssh/Jayred365-rsync-key"
|
||||
#-----------------------------------------------------------------------------------------------
|
||||
#----------------- User Variables --------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------------------------
|
||||
@@ -152,11 +153,11 @@ fi
|
||||
|
||||
# SSH Key Mapping
|
||||
declare -A SSH_KEYS
|
||||
SSH_KEYS["$HOST1|$HOST2"]="/root/.ssh/Gmer4Lfe-rsync-key"
|
||||
SSH_KEYS["$HOST2|$HOST1"]="/root/.ssh/Jayred365-rsync-key"
|
||||
SSH_KEYS["$HOST1|$HOST2"]="$HOST1_SSH_KEY"
|
||||
SSH_KEYS["$HOST2|$HOST1"]="$HOST2_SSH_KEY"
|
||||
|
||||
# Determine which key to use
|
||||
KEY_ID="$LOCAL_SERVER_NAME|$REMOTE_SERVER_NAME"
|
||||
|
||||
if [[ -n "${SSH_KEYS[$KEY_ID]}" ]]; then
|
||||
SSH_KEY="${SSH_KEYS[$KEY_ID]}"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user