This commit is contained in:
2023-07-04 17:28:01 -05:00
parent 88d9592084
commit 4954838946
3 changed files with 36 additions and 77 deletions

View File

@@ -1,5 +1,5 @@
VERS='4.8.11-07042023'
VERS='4.8.15-07042023'
noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns '
CERT_DAEMON='/snap/bin/certbot'
@@ -109,8 +109,8 @@ if [ -f ${NM_FOLDER}/defaults.local.inc ]; then
fi
TSI=$(/sbin/ip link | grep tailscale0)
[ ${#TSI} != 0 ] && TSIP=$(/sbin/ip -o -4 addr list tailscale0 | awk '{print $4}' | cut -d/ -f1) || TSIP=
RNIP=$(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1)
[ ${#TSI} != 0 ] && RUN_NODE_TSIP=$(/sbin/ip -o -4 addr list tailscale0 | awk '{print $4}' | cut -d/ -f1) || RUN_NODE_TSIP=
RNIP=${RUN_NODE_IP}
for NTYPE in "${NM_NODE_TYPES[@]}"; do
var=${NTYPE}_HOSTS[@]
RUN_NODE_TYPE=""
@@ -119,17 +119,14 @@ for NTYPE in "${NM_NODE_TYPES[@]}"; do
RUN_NODE_TYPE=${NTYPE};
RUN_NODE_IP=${RNIP}
break 2
elif [[ "${TSIP}" == *"${nip}"* ]]; then
elif [[ "${RUN_NODE_TSIP}" == *"${nip}"* ]]; then
RUN_NODE_TYPE=${NTYPE};
RUN_NODE_IP=${TSIP}
RUN_NODE_IP=${RUN_NODE_TSIP}
break 2
fi
done
done
echo "RUN_NODE_IP: $RUN_NODE_IP"
echo "RUN_NODE_TYPE: $RUN_NODE_TYPE"
declare -A NM_SRVCOPTS
NM_SRVCOPTS['status']='Status'
NM_SRVCOPTS['start']='Start'