diff --git a/packaging/scripts/postinstall.sh b/packaging/scripts/postinstall.sh index 67c3d10ba..e484d920f 100644 --- a/packaging/scripts/postinstall.sh +++ b/packaging/scripts/postinstall.sh @@ -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 # 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" < "$USER_CHOICE_CONFIG" <