From a4a80a4d0bcfb46eab399400c4b6cb4acd2d9e31 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 9 Nov 2024 22:38:20 -0600 Subject: [PATCH] Update defaults.inc --- defaults.inc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/defaults.inc b/defaults.inc index 3d4b31ee..8d99f782 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='2.7.122b-11092024' +VERS='2.7.123-11092024' noheader=' update service dailytemp confsync -r -report test ' @@ -57,7 +57,10 @@ PW_ESXI_FANSPEEDCONTROLHOSTS=(${PW_ESXI_FANSPEEDCONTROL_HOSTS}) [ "${PW_TEMPIND_RANGE}" != "" ] && PW_TEMPIND_RANGE=(${PW_TEMPIND_RANGE}) unset IFS -if [ -f ${PW_FOLDER}/conf/settings.local.conf ]; then +IP=$(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1) +[[ "${IP}" = "10.2.1."* ]] && loo=offsite || loo=local + +if [ -f ${PW_FOLDER}/conf/settings.${loo}.conf ]; then declare -A PW_POWERWALL_SERVICES declare -A PW_THRESHOLDS declare -A PW_SENSOR_TYPE @@ -78,12 +81,12 @@ if [ -f ${PW_FOLDER}/conf/settings.local.conf ]; then declare -A PW_MISCSENSOR_DESC declare -A PW_DESC_TEMP - source ${PW_FOLDER}/conf/settings.local.conf + source ${PW_FOLDER}/conf/settings.${loo}.conf [ "${PW_TEMPIND_DIFF}" == "" ] && PW_TEMPIND_DIFF=1 else - echo "NO settings.local.conf FILE FOUND" + echo "NO settings.${loo}.conf FILE FOUND" [ "${1}" ] && [ "${1}" != "update" ] && exit 1 fi