From 86fb6ab5cef573936de640ef809d6dcad2f2b334 Mon Sep 17 00:00:00 2001 From: Fincer Date: Tue, 15 Nov 2016 16:21:27 +0200 Subject: [PATCH] Various fixes + check internet connection --- linux-install.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/linux-install.sh b/linux-install.sh index 7bde4d2..6fe65a2 100755 --- a/linux-install.sh +++ b/linux-install.sh @@ -24,6 +24,16 @@ if [[ $UID = 0 ]]; then exit 1 fi +##------------------------------------------------------------- +# Check internet connection + +INTERNET_TEST=$(ping -c 3 github.com 2>&1 | grep -c "unknown host") #Ping Github three times and look for string 'unknown host' + +if [[ ! $INTERNET_TEST -eq 0 ]]; then #If 'unknown host' string is found, then + echo -e "\nCan't connect to Github. Please check your internet connection and try again.\n" + exit 1 +fi + ##------------------------------------------------------------- # Get our current directory WORKING_DIR=$(pwd) @@ -86,8 +96,8 @@ if [[ $DISTRO =~ "$ARCH" ]]; then echo -e "Use custom hotfixes if added by the user (Default: No)?\nNOTE: If you choose YES (y), be aware that your OpenRA/RA2 version will likely not be compatible with the other players unless they've applied exactly same hotfixes in their game versions, too!" echo -e "\nAvailable hotfixes are:\n" echo -e $green_in$(find $WORKING_DIR/data/hotfixes/linux/ -type f -iname *.patch | sed -e 's/.*\///' -e 's/\.[^\.]*$//')$out - echo -e "" - read -r -p "Use these hotfixes? (y/N) " hotfixes + echo -e "\nMore information about hotfixes: https://github.com/Fincer/openra-tibsunra2/#about-patches--hotfixes\n" + read -r -p "Use these hotfixes? [y/N] " hotfixes if [[ $hotfixes =~ ^([nN][oO][nN]|)$ ]]; then echo -e "\nHotfixes ignored and skipped. Continuing." elif [[ $hotfixes =~ ^([yY][eE][sS]|[yY])$ ]]; then