Service: put the restart flag into /tmp (#6430)
Some checks failed
Release / call-build-workflow (push) Has been cancelled
Release / Publish Docker :release (push) Has been cancelled
Release / Github & APT (push) Has been cancelled
Release / Demo (push) Has been cancelled
Release / Hassio Addon (push) Has been cancelled

This commit is contained in:
Stephan Pauxberger 2023-02-25 11:58:03 +01:00 • committed by GitHub
parent 6971eb365d
commit 4956725171
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -4,7 +4,7 @@ set -e
USER_CHOICE_CONFIG="/etc/evcc-userchoices.sh"
ETC_SERVICE="/etc/systemd/system/evcc.service"
USR_LOCAL_BIN="/usr/local/bin/evcc"
RESTART_FLAG_FILE=/var/lib/evcc/.restartOnUpgrade
RESTART_FLAG_FILE="/tmp/.restartEvccOnUpgrade"
# Usage: askUserKeepFile <file>
# Return: 1 = keep, 0 = delete
@ -12,7 +12,7 @@ askUserKeepFile() {
while true; do
echo "Shall '$1' be deleted? [Y/n]: "
read answer
case "$answer" in
case "$answer" in
n*|N*)
echo "Ok. We will keep that file. Keep in mind that you may need to alter it if any changes are done upstream. Your answer is saved for the future."
return 1
@ -45,7 +45,7 @@ if [ "$1" = "configure" ]; then
echo "This is probably due to a previous manual installation."
echo "You probably want to delete this file now. Your evcc configuration stays untouched!"
askUserKeepFile "$ETC_SERVICE" || KEEP_ETC_SERVICE=$?
fi
fi
if [ -f "$USR_LOCAL_BIN" ] && [ "$KEEP_USR_LOCAL_BIN" -eq 0 ]; then
echo "An alternate evcc binary was detected under '$USR_LOCAL_BIN'."
echo "This is probably due to a previous manual installation."
@ -53,7 +53,7 @@ if [ "$1" = "configure" ]; then
askUserKeepFile "$USR_LOCAL_BIN" || KEEP_USR_LOCAL_BIN=$?
fi
# Save the user decision
cat > "$USER_CHOICE_CONFIG" <<EOF
cat > "$USER_CHOICE_CONFIG" <<EOF
#!/bin/sh
KEEP_ETC_SERVICE=$KEEP_ETC_SERVICE
KEEP_USR_LOCAL_BIN=$KEEP_USR_LOCAL_BIN

View file

@ -10,7 +10,7 @@ set -e
EVCC_USER=evcc
EVCC_GROUP=evcc
EVCC_HOME="/var/lib/$EVCC_USER"
RESTART_FLAG_FILE=$EVCC_HOME/.restartOnUpgrade
RESTART_FLAG_FILE="/tmp/.restartEvccOnUpgrade"
copyDbToUserDir() {
CURRENT_USER=$(systemctl show -pUser evcc | cut -d= -f2)