Skip to content

Commit

Permalink
Support customised powerwall.yml through upgrade.
Browse files Browse the repository at this point in the history
Supports a customised powerwall through the upgrade by preserving it before the upgrade by copying it to a .restore copy, and restoring it after the git pull before restarting the containers.
  • Loading branch information
BJReplay authored Feb 20, 2023
1 parent 3252601 commit f5bf483
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ else
exit
fi

# Preserve Customised powerwall.yml?
read -r -p "Do you want to preserve a customised powerwall.yml (only for specialised users)? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]
then
echo "preseving powerwall.yml"
cp "powerwall.yml" "powerwall.yml.restore"
else
echo "Replacing powerwall.yml with standard as part of upgrade"
fi


# Remember Timezome and Reset to Default
echo "Resetting Timezone to Default..."
DEFAULT="America/Los_Angeles"
Expand Down Expand Up @@ -140,6 +151,12 @@ if ! grep -q "TZ=" pypowerwall.env; then
echo "TZ=America/Los_Angeles" >> pypowerwall.env
fi

if [ -f powerwall.yml.preserve ]; then
echo "restoring preserved powerwall.yml"
cp "powerwall.yml.restore" "powerwall.yml"
fi


# Make sure stack is running
echo ""
echo "Start Powerwall-Dashboard stack..."
Expand Down

0 comments on commit f5bf483

Please sign in to comment.