This commit is contained in:
2026-03-24 20:14:02 +00:00
parent d24d108a5b
commit 718f921227
+10 -14
View File
@@ -85,12 +85,9 @@ require_var() {
}
#-----------------------------------------------------------------------------------------------
# Detect hosts + networking + SSH key
# Host + Remote + SSH Detection (RUN THIS AFTER load_master_conf)
#-----------------------------------------------------------------------------------------------
detect_hosts() {
# Ensure required config exists
require_var HOST1
require_var HOST2
detect_remote() {
# Detect local hostname
LOCAL_HOSTNAME="$(hostname)"
@@ -109,18 +106,17 @@ detect_hosts() {
echo "Local server: $LOCAL_SERVER_NAME"
echo "Remote server: $REMOTE_SERVER_NAME"
REMOTE_SERVER=$(tailscale ip -4 "$REMOTE_SERVER_NAME" 2>/dev/null || true)
# Resolve Tailscale IP
REMOTE_SERVER=$(tailscale ip -4 "$REMOTE_SERVER_NAME" 2>/dev/null)
if [[ -z "$REMOTE_SERVER" ]]; then
echo "Error: Could not resolve Tailscale IP for $REMOTE_SERVER_NAME"
echo "Debug: tailscale status:"
tailscale status 2>/dev/null || echo "tailscale not available"
exit 1
fi
if [[ -z "$REMOTE_SERVER" ]]; then
echo "Error: Could not resolve Tailscale IP for $REMOTE_SERVER_NAME"
exit 1
fi
echo "Resolved $REMOTE_SERVER_NAME$REMOTE_SERVER"
echo "Resolved $REMOTE_SERVER_NAME$REMOTE_SERVER"
# SSH Key Mapping (kept here for stability)
# 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"