Update run.sh

This commit is contained in:
2024-11-30 16:36:08 -06:00
parent d10a8525d9
commit c62c15d697

22
run.sh
View File

@@ -42,21 +42,23 @@ if [ "${1}" == "update" ]; then
git prune >/dev/null 2>&1 git prune >/dev/null 2>&1
git pull >/dev/null 2>&1 git pull >/dev/null 2>&1
git submodule update --remote >/dev/null 2>&1 git submodule update --remote >/dev/null 2>&1
/bin/chmod +x /opt/idssys/powerwall/powerwall.sh 2>&1 /bin/chmod +x ${PW_FOLDER}/powerwall.sh 2>&1
source ${PW_FOLDER}/defaults.inc source ${PW_FOLDER}/defaults.inc
if [ "${2}" != "q" ]; then if [ "${2}" != "q" ]; then
echo -en "\e[1A"; echo -en "\e[1A";
echo -e "\e[0K\r ${idsCL[Green]}Update to v${VERS} complete${idsCL[Default]}" echo -e "\e[0K\r ${idsCL[Green]}Update to v${VERS} complete${idsCL[Default]}"
fi fi
echo -en "${idsCL[LightCyan]}Do you want to restart PowerWall Services as well? (y/N): " if [ ! -f ${PW_TMPFOLDER}/.singleserver.PW.secondary ]; then
read -n 1 choice echo -en "${idsCL[LightCyan]}Do you want to restart PowerWall Services as well? (y/N): "
case "$choice" in read -n 1 choice
[Yy]) case "$choice" in
echo -e "\n\n${idsCL[Yellow]}Restarting Powerwall services to apply update ..." [Yy])
${PW_SCRIPT} service all restart echo -e "\n\n${idsCL[Yellow]}Restarting Powerwall services to apply update ..."
;; ${PW_SCRIPT} service all restart
*) echo;; ;;
esac *) echo;;
esac
fi
elif [ "${2}" != "q" ]; then elif [ "${2}" != "q" ]; then
echo -en "\e[1A"; echo -en "\e[1A";