diff options
author | Daniel Hansson <github@hanssonit.se> | 2019-04-10 23:00:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-10 23:00:36 +0300 |
commit | 5f840d5e8f4f061bf3e83a48d268ff05142bff7c (patch) | |
tree | c49037d2d1ff5b9dd1e4ae0517f3a9032fb1d6a5 /static/test_connection.sh | |
parent | 71104d55237c82d50ff5a3b17285d00eed201d8c (diff) |
replace wget with curl (#812)
Signed-off-by: enoch85 <github@hanssonit.se>
Diffstat (limited to 'static/test_connection.sh')
-rw-r--r-- | static/test_connection.sh | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/static/test_connection.sh b/static/test_connection.sh index fea1b4be..7ac65c2f 100644 --- a/static/test_connection.sh +++ b/static/test_connection.sh @@ -12,10 +12,24 @@ true DEBUG=0 debug_mode -$WGET -q --tries=20 --timeout=10 http://www.github.com -O /tmp/github.idx &> /dev/null -if [ ! -s /tmp/github.idx ] +curl_to_dir() { + check_command curl -sSL "$1"/"$2" -o "$3"/"$2" +} + +# Colors +Color_Off='\e[0m' +IRed='\e[0;91m' +IGreen='\e[0;92m' +ICyan='\e[0;96m' + +print_text_in_color() { + printf "%b%s%b\n" "$1" "$2" "$Color_Off" +} + +curl_to_dir google.com google.connectiontest /tmp +if [ ! -s /tmp/google.connectiontest ] then - printf "${Red}Not Connected!${Color_Off}\n" + print_text_in_color "$IRed" "Not connected!" else - printf "Connected!\n" + print_text_in_color "$IGreen" "Connected!" fi |