From 06300599b79c675739aac21f2089ac113f0666ec Mon Sep 17 00:00:00 2001 From: Rhys Ferris Date: Wed, 6 Mar 2019 17:07:10 -0500 Subject: [PATCH 1/2] Updated to use https and adjusted for the word "success" on the website --- checkport.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkport.sh b/checkport.sh index 8ad452e..344ad44 100755 --- a/checkport.sh +++ b/checkport.sh @@ -6,7 +6,7 @@ then exit else IP_ADDRESS=$(curl ifconfig.me/ip) - RESULT=$(curl --data "port=$1&IP=$IP_ADDRESS" http://www.canyouseeme.org |grep -i success) + RESULT=$(curl --data "port=$1&IP=$IP_ADDRESS" https://www.canyouseeme.org |grep Success) if [ -z $RESULT ] then From 8cf01efaca13b8a1ac9c3ab7cf89288fceb23bc8 Mon Sep 17 00:00:00 2001 From: rhysers Date: Wed, 6 Mar 2019 18:37:00 -0500 Subject: [PATCH 2/2] Removed Extraneous output --- checkport.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/checkport.sh b/checkport.sh index 344ad44..a453556 100755 --- a/checkport.sh +++ b/checkport.sh @@ -5,14 +5,14 @@ then echo -e "Usage: checkport [port number]" exit else - IP_ADDRESS=$(curl ifconfig.me/ip) - RESULT=$(curl --data "port=$1&IP=$IP_ADDRESS" https://www.canyouseeme.org |grep Success) + IP_ADDRESS=$(curl --silent ifconfig.me/ip) > /dev/null + RESULT=$(curl --silent --data "port=$1&IP=$IP_ADDRESS" https://www.canyouseeme.org |grep Success) - if [ -z $RESULT ] + if [[ -z $RESULT ]] then - echo -e "\nThe port $1 is NOT open!" + echo -e "The port $1 is NOT open!" else - echo -e "\nThe port $1 IS open!" + echo -e "The port $1 IS open!" fi fi