diff options
author | Daniel Hansson <daniel@techandme.se> | 2017-03-20 17:07:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-20 17:07:25 +0300 |
commit | bb6b0a10c66adb108e04df6f835d717d9cab75aa (patch) | |
tree | e5ba15e8b5524b076fbe9ecc710c137e1e4fdd50 /lets-encrypt | |
parent | 111ddf55fad05dd5e50ff6812a5787ddad4b0324 (diff) |
check with both curl and wget
Diffstat (limited to 'lets-encrypt')
-rw-r--r-- | lets-encrypt/activate-ssl.sh | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lets-encrypt/activate-ssl.sh b/lets-encrypt/activate-ssl.sh index 9551fd95..480b2eba 100644 --- a/lets-encrypt/activate-ssl.sh +++ b/lets-encrypt/activate-ssl.sh @@ -182,21 +182,24 @@ else chmod +x $SCRIPTS/test-new-config.sh fi - # Check if $domain exists and is reachable echo echo "Checking if $domain exists and is reachable..." -wget -q -T 10 -t 2 $domain > /dev/null -if [[ $? > 0 ]] -then +if wget -q -T 10 -t 2 --spider $domain; then + sleep 1 +elif wget -q -T 10 -t 2 --spider --no-check-certificate https://$domain; then + sleep 1 +elif curl -s -k -m 10 $domain; then + sleep 1 +elif curl -s -k -m 10 https://$domain > /dev/null ; then + sleep 1 +else echo "Nope, it's not there. You have to create $domain and point" echo "it to this server before you can run this script." echo -e "\e[32m" read -p "Press any key to continue... " -n1 -s echo -e "\e[0m" exit 1 -else - rm *.html fi # Install letsencrypt |