From 3b177bd87099534eb5a1ce01a2864bf0b38cfea6 Mon Sep 17 00:00:00 2001 From: Ace Date: Thu, 18 Apr 2019 13:22:26 +0200 Subject: [PATCH] Update prototype.sh --- prototype.sh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/prototype.sh b/prototype.sh index 9ff1311..313663b 100644 --- a/prototype.sh +++ b/prototype.sh @@ -46,10 +46,27 @@ if [ "$option" = 1 ]; then echo "Updating now..." cd else - echo -e "Could not find any settings.py file in /home/pi/Inky-Calendar/Calendar" - echo -e "Please uninstall the software first and then use the install option" - echo -e "Exiting now" - exit + # Ask to update anyway. May not work always, but can help with new versions. + echo -e "\e[1mCould not find the configuration file -settings.py- in /home/pi/Inky-Calendar/Calendar" + echo -e "\e[1mWould you like to update the Inky-Calendar software anyway?" + echo -e "\e[97mPlease type [y] for yes or [n] for no and confirm your selection with [ENTER]" + read -r -p 'Waiting for input... ' update_anyway + + if [ "$update_anyway" != Y ] && [ "$update_anyway" != y ] && [ "$update_anyway" != N ] && [ "$update_anyway" != n ]; then + echo -e "invalid input, aborting now" + exit + fi + if [ -z "$update_anyway" ]; then + echo -e "You didn't enter anything, aborting now." + exit + fi + + if [ "$update_anyway" = Y ] || [ "$update_anyway" = y ]; then + echo "Updating now..." + else + echo -e "Not attempting to update, exiting now." + exit + fi fi fi