From 9d458782fcf50504d897dd3190dcc6edc38ed050 Mon Sep 17 00:00:00 2001 From: taniman Date: Thu, 9 Aug 2018 00:27:20 +0200 Subject: [PATCH] Insert a check for curl (#2013) * Insert a check for curl * typo * confirmation messages --- update.sh | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/update.sh b/update.sh index d3c5e04..a10c206 100644 --- a/update.sh +++ b/update.sh @@ -1,7 +1,7 @@ #!/bin/bash ### Linux .jar Update Script for ProfitTrailer -### LAST UPDATED 23 JULY 2018 +### LAST UPDATED 09 August 2018 ### Place this script in the root folder where all your individual bot folders are and then execute it. ### For simplicity each ProfitTrailer.jar file should be nested exactly one subfolder. @@ -32,6 +32,40 @@ if ! [ -x "$(command -v unzip)" ]; then ### install unzip if the user wants to proceed ### if [[ "$install" == "y" ]] || [[ "$install" == "Y" ]]; then sudo apt install unzip + + if ! [ -x "$(command -v unzip)" ]; then + echo "$(tput setaf 1)Something went wrong.... $(tput sgr0)" + echo + exit + else + echo $(tput setaf 2) + echo "Unzip Installed" + echo $(tput sgr0) + fi + else + echo "$(tput setaf 1)Process Aborted.... $(tput sgr0)" + echo + exit + fi +fi + +### Check if curl is installed ### +if ! [ -x "$(command -v curl)" ]; then + read -p "Curl is not installed, Do you wish to install it (Y/N)? : " install + + ### install curl if the user wants to proceed ### + if [[ "$install" == "y" ]] || [[ "$install" == "Y" ]]; then + sudo apt install curl + + if ! [ -x "$(command -v curl)" ]; then + echo "$(tput setaf 1)Something went wrong.... $(tput sgr0)" + echo + exit + else + echo $(tput setaf 2) + echo "Curl Installed" + echo $(tput sgr0) + fi else echo "$(tput setaf 1)Process Aborted.... $(tput sgr0)" echo