Testing Installer for v1.5
This commit is contained in:
		| @@ -1,12 +1,49 @@ | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
| # This script is for automating the install for both displays, | # E-Paper-Calendar software installer for the raspberry pi | ||||||
| # The 2-colour and 3-colour one. | # Version: 1.5 (Early Februrary 2019) | ||||||
| # Version: 1.5 (Mid February 2019) | # Well tested and confirmed on 3rd Feb 2019 | ||||||
| # Last tested on ? |  | ||||||
|  |  | ||||||
| # Copyright by aceisace | # Copyright by aceisace | ||||||
|  |  | ||||||
|  | echo -e "\e[1mPlease select an option from below:" | ||||||
|  | echo -e "\e[97mEnter \e[91m1 \e[97m to install/update the E-Paper software" | ||||||
|  | echo -e "\e[97mEnter \e[91m2 \e[97m to uninstall the E-Paper software" | ||||||
|  | echo -e "\e[1mNote: Updating will back up just the settings.py file." | ||||||
|  | echo -e "\e[97mConfirm your selection with [ENTER]" | ||||||
|  | read -r -p 'Waiting for input...  ' option | ||||||
|  |  | ||||||
|  | if [ "$option" != 1 ] && [ "$option" != 2 ]; then | ||||||
|  |     echo "invalid number, aborting now" | ||||||
|  |     exit | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | if [ -z "$option" ]; then | ||||||
|  |     echo "You didn't enter anything, aborting now." | ||||||
|  |     exit | ||||||
|  | fi | ||||||
|  |  | ||||||
|  |  | ||||||
|  | if [ "$option" = 2 ]; then | ||||||
|  |     echo "Removing the E-Paper software now..." | ||||||
|  |     pip3 uninstall Pillow && sudo pip3 uninstall Pillow && sudo pip3 uninstall pyowm && sudo pip3 uninstall ics && pip3 uninstall pyowm && pip3 uninstall ics && sudo apt-get remove --purge supervisor -y && sudo apt-get clean && sudo apt-get autoremove -y && sudo rm -r /home/pi/E-Paper-Master/ | ||||||
|  | fi | ||||||
|  |  | ||||||
|  |  | ||||||
|  | if [ "$option" = 1 ]; then | ||||||
|  |     echo "Checking if the software is installed" | ||||||
|  |     if [ -e /home/pi/E-Paper-Master/Calendar/settings.py ] | ||||||
|  |     then | ||||||
|  |         echo "Found an E-Paper settings file." | ||||||
|  |         sleep 2 | ||||||
|  | 	echo "Backing up the current settings file in the home directory." | ||||||
|  | 	sleep 2 | ||||||
|  | 	cp /home/pi/E-Paper-Master/Calendar/settings.py /home/pi/settings-old.py | ||||||
|  | 	echo "renaming the old E-Paper software folder" | ||||||
|  | 	sleep 2 | ||||||
|  | 	cp -r /home/pi/E-Paper-Master /home/pi/E-Paper-Master-old | ||||||
|  | 	echo "Updating now..." | ||||||
|         # Getting input to see which E-Paper version is currently being used. |         # Getting input to see which E-Paper version is currently being used. | ||||||
|  |     fi | ||||||
|     echo -e "\e[1mWhich version of the E-Paper display are you using?" |     echo -e "\e[1mWhich version of the E-Paper display are you using?" | ||||||
|     echo -e "\e[97mEnter \e[91m2 \e[97m if you are using the 2-Colour E-Paper" |     echo -e "\e[97mEnter \e[91m2 \e[97m if you are using the 2-Colour E-Paper" | ||||||
|     echo -e "\e[97mEnter \e[91m3 \e[97m if you are using the 3-Colour E-Paper" |     echo -e "\e[97mEnter \e[91m3 \e[97m if you are using the 3-Colour E-Paper" | ||||||
| @@ -45,6 +82,7 @@ sudo apt-get install python3-pip python-rpi.gpio-dbgsym python3-rpi.gpio python- | |||||||
|     pip3 install Pillow==5.3.0 |     pip3 install Pillow==5.3.0 | ||||||
|     sudo pip3 install Pillow==5.3.0 |     sudo pip3 install Pillow==5.3.0 | ||||||
|     echo "" |     echo "" | ||||||
|  | fin | ||||||
|  |  | ||||||
|     # Running apt-get clean and apt-get autoremove |     # Running apt-get clean and apt-get autoremove | ||||||
|     echo -e "\e[1;36m"Cleaning a bit of mess to free up some space..."\e[0m" |     echo -e "\e[1;36m"Cleaning a bit of mess to free up some space..."\e[0m" | ||||||
| @@ -60,6 +98,7 @@ pip3 install ics | |||||||
|     echo "" |     echo "" | ||||||
|  |  | ||||||
|     echo -e "\e[1;36m"Installing the E-Paper-Calendar Software for your display"\e[0m" |     echo -e "\e[1;36m"Installing the E-Paper-Calendar Software for your display"\e[0m" | ||||||
|  |     cd | ||||||
|     git clone https://github.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather |     git clone https://github.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather | ||||||
|     mkdir E-Paper-Master |     mkdir E-Paper-Master | ||||||
|     cd E-Paper-Calendar-with-iCal-sync-and-live-weather |     cd E-Paper-Calendar-with-iCal-sync-and-live-weather | ||||||
| @@ -72,9 +111,6 @@ sudo rm -r E-Paper-Calendar-with-iCal-sync-and-live-weather | |||||||
|  |  | ||||||
|     # Using this part for the 2-colour E-Paper version |     # Using this part for the 2-colour E-Paper version | ||||||
|     if [ "$digit" = 2 ]; then |     if [ "$digit" = 2 ]; then | ||||||
|     # execute the monocolour-converter to convert all 3-colour icons to 2-colour ones |  | ||||||
|     python3.5 /home/pi/E-Paper-Master/Calendar/monocolour-converter.py |  | ||||||
|      |  | ||||||
|         # edit the settings file for the 2-colour display option |         # edit the settings file for the 2-colour display option | ||||||
|         sed -i 's/display_colours = "bwr"/display_colours = "bw"/' /home/pi/E-Paper-Master/Calendar/settings.py |         sed -i 's/display_colours = "bwr"/display_colours = "bw"/' /home/pi/E-Paper-Master/Calendar/settings.py | ||||||
|          |          | ||||||
| @@ -83,7 +119,7 @@ if [ "$digit" = 2 ]; then | |||||||
|     This document contains a short info of the E-Paper-Calendar software version |     This document contains a short info of the E-Paper-Calendar software version | ||||||
|  |  | ||||||
|     Version: 2-Colour E-Paper-version |     Version: 2-Colour E-Paper-version | ||||||
| Installer version: 1.5 (Mid February 2018) |     Installer version: 1.5 (Early February 2019) | ||||||
|     configuration file: /home/pi/E-Paper-Master/Calendar/settings.py |     configuration file: /home/pi/E-Paper-Master/Calendar/settings.py | ||||||
|     If the time was set correctly, you installed this software on: |     If the time was set correctly, you installed this software on: | ||||||
| EOF | EOF | ||||||
| @@ -98,7 +134,7 @@ if [ "$digit" = 3 ]; then | |||||||
|     This document contains a short info of the version |     This document contains a short info of the version | ||||||
|  |  | ||||||
|     Version: 3-Colour E-Paper-version |     Version: 3-Colour E-Paper-version | ||||||
| Installer version: 1.5 (Mid February 2019) |     Installer version: 1.5 (Early February 2019) | ||||||
|     configuration file: /home/pi/E-Paper-Master/Calendar/settings.py |     configuration file: /home/pi/E-Paper-Master/Calendar/settings.py | ||||||
|     If the time was set correctly, you installed this software on: |     If the time was set correctly, you installed this software on: | ||||||
| EOF | EOF | ||||||
| @@ -131,3 +167,5 @@ echo -e "\e[1;31m"If this file is not modified, the programm will not start"\e[0 | |||||||
|  |  | ||||||
|     echo -e "\e[1;36m"To modify the settings file, enter:"\e[0m" |     echo -e "\e[1;36m"To modify the settings file, enter:"\e[0m" | ||||||
|     echo -e "\e[1;36m"nano /home/pi/E-Paper-Master/Calendar/settings.py"\e[0m" |     echo -e "\e[1;36m"nano /home/pi/E-Paper-Master/Calendar/settings.py"\e[0m" | ||||||
|  |  | ||||||
|  | fi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user