This commit is contained in:
2024-12-01 18:05:05 -06:00
parent 753e1a6a7d
commit ce2c2f7213
3 changed files with 12 additions and 7 deletions

View File

@@ -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}

View File

@@ -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

2
run.sh
View File

@@ -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