From 96147bd4f5338650e92ee119292ca48ece765b79 Mon Sep 17 00:00:00 2001 From: Romain Hunault Date: Tue, 23 Apr 2019 08:15:50 +0000 Subject: [PATCH] Handle no internet connection --- get-e.sh | 6 ++++++ get-twrp.sh | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/get-e.sh b/get-e.sh index 15d4964..ee71e96 100755 --- a/get-e.sh +++ b/get-e.sh @@ -29,12 +29,18 @@ # - 6 : Username/password authentication failure (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html) # - 7 : Protocol errors (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html) # - 8 : Server issued an error response (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html) +# - 10: No internet connection # - 101 : E_ARCHIVE_URL missing # - 102 : E_FOLDER missing E_ARCHIVE_URL=$1 E_FOLDER=$2 +if ! ping -c 1 spot.ecloud.global 2>&1 >/dev/null +then + exit 10 +fi + if [ -z ${E_FOLDER} ] then exit 101 diff --git a/get-twrp.sh b/get-twrp.sh index 0b9b6aa..cccfd96 100755 --- a/get-twrp.sh +++ b/get-twrp.sh @@ -29,12 +29,18 @@ # - 6 : Username/password authentication failure (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html) # - 7 : Protocol errors (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html) # - 8 : Server issued an error response (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html) +# - 10: No internet connection # - 101 : TWRP_IMG_URL missing # - 102 : TWRP_FOLDER missing TWRP_IMG_URL=$1 TWRP_FOLDER=$2 +if ! ping -c 1 spot.ecloud.global 2>&1 >/dev/null +then + exit 10 +fi + if [ -z ${TWRP_IMG_URL} ] then exit 101 -- GitLab