From 0f4d46f5d99afa7f7efe647263aeae19c8775073 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Wed, 1 Mar 2017 23:24:22 +0100 Subject: [PATCH] Change from curl to wget (#145) --- lets-encrypt/activate-ssl.sh | 2 +- nextcloud-startup-script.sh | 4 ++-- nextcloud_install_production.sh | 2 +- nextcloud_update.sh | 2 +- static/collabora.sh | 2 +- static/nextcloud.sh | 4 ++-- static/ntpdate.sh | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lets-encrypt/activate-ssl.sh b/lets-encrypt/activate-ssl.sh index 07bc788d..6acc6bc6 100644 --- a/lets-encrypt/activate-ssl.sh +++ b/lets-encrypt/activate-ssl.sh @@ -164,7 +164,7 @@ fi # Check if $domain exists and is reachable echo echo "Checking if $domain exists and is reachable..." -curl -s -m 20 $domain > /dev/null +wget -q -T 10 -t 2 $domain > /dev/null if [[ $? > 0 ]] then echo "Nope, it's not there. You have to create $domain and point" diff --git a/nextcloud-startup-script.sh b/nextcloud-startup-script.sh index e7f4f5fb..cf2eae1c 100644 --- a/nextcloud-startup-script.sh +++ b/nextcloud-startup-script.sh @@ -42,7 +42,7 @@ fi # Check network echo "Testing if network is OK..." service networking restart - curl -s http://github.com > /dev/null + wget -q -T 10 -t 2 http://github.com > /dev/null if [ $? -eq 0 ] then echo -e "\e[32mOnline!\e[0m" @@ -57,7 +57,7 @@ fi # Check network echo "Testing if network is OK..." service networking restart - curl -s http://github.com > /dev/null + wget -q -T 10 -t 2 http://github.com > /dev/null if [ $? -eq 0 ] then echo -e "\e[32mOnline!\e[0m" diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh index 36408d5a..211b4cc7 100644 --- a/nextcloud_install_production.sh +++ b/nextcloud_install_production.sh @@ -106,7 +106,7 @@ if ! version 16.04 "$DISTRO" 16.04.4; then fi # Check if key is available -if curl -s "$NCREPO" > /dev/null +if wget -q -T 10 -t 2 "$NCREPO" > /dev/null then echo "Nextcloud repo OK" else diff --git a/nextcloud_update.sh b/nextcloud_update.sh index 1677ae44..2e508830 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -22,7 +22,7 @@ NCREPO="https://download.nextcloud.com/server/releases" SECURE="$SCRIPTS/setup_secure_permissions_nextcloud.sh" # Versions CURRENTVERSION=$(sudo -u www-data php $NCPATH/occ status | grep "versionstring" | awk '{print $3}') -NCVERSION=$(curl -s --max-time 900 $NCREPO/ | tac | grep unknown.gif | sed 's/.*"nextcloud-\([^"]*\).zip.sha512".*/\1/;q') +NCVERSION=$(curl -s -m 900 $NCREPO/ | tac | grep unknown.gif | sed 's/.*"nextcloud-\([^"]*\).zip.sha512".*/\1/;q') # Must be root [[ `id -u` -eq 0 ]] || { echo "Must be root to run script, in Ubuntu type: sudo -i"; exit 1; } diff --git a/static/collabora.sh b/static/collabora.sh index 4a15aaea..0efca974 100644 --- a/static/collabora.sh +++ b/static/collabora.sh @@ -96,7 +96,7 @@ fi # Check if $SUBDOMAIN exists and is reachable echo echo "Checking if $SUBDOMAIN exists and is reachable..." -curl -s -m 20 $SUBDOMAIN > /dev/null +wget -q -T 10 -t 2 $SUBDOMAIN > /dev/null if [[ $? > 0 ]] then echo "Nope, it's not there. You have to create $SUBDOMAIN and point" diff --git a/static/nextcloud.sh b/static/nextcloud.sh index 71fefd28..368a5de1 100644 --- a/static/nextcloud.sh +++ b/static/nextcloud.sh @@ -1,6 +1,6 @@ #!/bin/bash -WANIP4=$(curl -s ipinfo.io/ip -m 5) -WANIP6=$(curl -s 6.ifcfg.me -m 5) +WANIP4=$(curl -s -m 5 ipinfo.io/ip) +WANIP6=$(curl -s -m 5 6.ifcfg.me) ADDRESS=$(hostname -I | cut -d ' ' -f 1) clear figlet -f small Nextcloud diff --git a/static/ntpdate.sh b/static/ntpdate.sh index ab6af1a2..ede9a2c9 100644 --- a/static/ntpdate.sh +++ b/static/ntpdate.sh @@ -1,5 +1,5 @@ #!/bin/bash -curl -s http://google.com > /dev/null +wget -q -T 10 -t 2 http://google.com > /dev/null if [ $? -eq 0 ] then ntpdate -s 1.se.pool.ntp.org