diff --git a/defaults.inc b/defaults.inc index 23d5ee80..1cc837c3 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='2.8.12-12012024' +VERS='2.8.12a-12012024' noheader=' update service dailytemp confsync -r -report test ' @@ -13,6 +13,9 @@ PW_INCFOLDER=${PW_FOLDER}/inc PW_LOGFOLDER=${PW_FOLDER}/logs PW_LOGARCHIVE=${PW_FOLDER}/logs/archive PW_TMPFOLDER=${PW_FOLDER}/.tmp +NM_FOLDER='/opt/idssys/nodemgmt' +NM_TMPFOLDER=${NM_FOLDER}/.tmp + [ ! -d ${PW_INCFOLDER} ] && mkdir ${PW_INCFOLDER} [ ! -d ${PW_LOGFOLDER} ] && mkdir ${PW_LOGFOLDER} [ ! -d ${PW_LOGARCHIVE} ] && mkdir ${PW_LOGARCHIVE} diff --git a/powerwall.sh b/powerwall.sh index 1ed6f7da..298c3dcc 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -744,16 +744,18 @@ GET_SNAPSHOTS(){ CONFSYNC(){ [ "${PW_OFFSITE_MONITOR}" != "" ] && rsync -az --timeout=3 ${PW_FOLDER}/conf root@${PW_OFFSITE_MONITOR}:${PW_FOLDER}/ & >/dev/null 2>&1 - if [ -f /opt/idssys/nodemgmt/conf/defaults.local.inc ]; then - source /opt/idssys/nodemgmt/defaults.inc - rsync -az --timeout=3 ${PW_FOLDER}/conf/* root@${NM_NODEMANAGER}:/opt/idssys/nodemgmt/conf/powerwall/ & >/dev/null 2>&1 - # rsync -az --timeout=3 ${PW_FOLDER}/conf/settings.ps1 root@${NM_NODEMANAGER}:/opt/idssys/nodemgmt/conf/powerwall.settings.ps1 & >/dev/null 2>&1 + if [ -f ${NM_FOLDER}/conf/defaults.local.inc ]; then + source ${NM_FOLDER}/defaults.inc + rsync -az --timeout=3 ${PW_FOLDER}/conf/* root@${NM_NODEMANAGER}:${NM_FOLDER}/conf/powerwall/ & >/dev/null 2>&1 + # rsync -az --timeout=3 ${PW_FOLDER}/conf/settings.ps1 root@${NM_NODEMANAGER}:${NM_FOLDER}/conf/powerwall.settings.ps1 & >/dev/null 2>&1 + else + fi } UPDATE_TINYTUYA_SERVER(){ TTS_FLDR=/opt/tinytuya-server - if [ ! -f /opt/raspiBackup.running ]; then + if [ ! -f /opt/raspiBackup.running ] && ([ -f ${NM_TMPFOLDER}/.singleserver.PW2.primary ] || [ -f ${NM_TMPFOLDER}/.singleserver.PWO2.primary ]); then if [ -d ${TTS_FLDR}/devices.json ]; then docker stop tinytuya-server rm -Rf ${TTS_FLDR}/devices.json diff --git a/run.sh b/run.sh index 5b54b20f..871810c0 100755 --- a/run.sh +++ b/run.sh @@ -48,7 +48,7 @@ if [ "${1}" == "update" ]; then echo -en "\e[1A"; echo -e "\e[0K\r ${idsCL[Green]}Update to v${VERS} complete${idsCL[Default]}" fi - if [ ! -f /opt/idssys/nodemgmt/.tmp/.singleserver.PW.secondary ] && [ ! -f /opt/idssys/nodemgmt/.tmp/.singleserver.PWO.secondary ]; then + if [ ! -f ${NM_TMPFOLDER}/.singleserver.PW.secondary ] && [ ! -f ${NM_TMPFOLDER}/.singleserver.PWO.secondary ]; then echo -en "${idsCL[LightCyan]}Do you want to restart PowerWall Services as well? (y/N): " read -n 1 choice case "$choice" in