Update run.sh

This commit is contained in:
2025-06-13 20:37:37 -05:00
parent ea53f21247
commit d43d6a090f

28
run.sh
View File

@@ -44,26 +44,32 @@ if [ "${1}" == "update" ]; then
git submodule update --remote >/dev/null 2>&1
/bin/chmod +x /opt/idssys/powerwall/powerwall.sh 2>&1
source /opt/idssys/powerwall/defaults.inc
if [ "${2}" != "q" ]; then
echo -en "\e[1A";
echo -e "\e[0K\r ${idsCL[Green]}Update to v${PW_VERS} complete${idsCL[Default]}"
fi
if [ -f ${NM_TMPFOLDER}/.singleserver.PW.primary ] || [ -f ${NM_TMPFOLDER}/.singleserver.PWO.primary ]; then
echo -en "${idsCL[LightCyan]}Do you want to restart PowerWall Services as well? (y/N): "
read -n 1 choice
case "$choice" in
[Yy])
echo -e "\n\n${idsCL[Yellow]}Restarting Powerwall services to apply update ..."
${PW_SCRIPT} service all restart
;;
*) echo;;
esac
if [ -f ${NM_TMPFOLDER}/.singleserver.PW.primary ] || [ -f ${NM_TMPFOLDER}/.singleserver.PWO.primary ]; then
echo -en "${idsCL[LightCyan]}Do you want to restart PowerWall Services as well? (y/N): "
read -n 1 choice
case "$choice" in
[Yy])
echo -e "\n\n${idsCL[Yellow]}Restarting Powerwall services to apply update ..."
${PW_SCRIPT} service all restart
;;
*) echo;;
esac
fi
else
${PW_SCRIPT} service all restart
fi
elif [ "${2}" != "q" ]; then
echo -en "\e[1A";
echo -e "\e[0K\r ${idsCL[LightCyan]}No Updates Available${idsCL[Default]}\n"
fi
fi
if [ "${2}" == "-a" ] || [ "${2}" == "all" ]; then
echo -e "${idsCL[White]}Updating the Offsite Monitor...${idsCL[Default]}"