From 4411d7ee0c72c44069a00c0c30439a6efa29b623 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 3 Mar 2022 15:06:00 -0300 Subject: [PATCH] =?UTF-8?q?probar=20la=20conexi=C3=B3n=20s=C3=B3lo=20cuand?= =?UTF-8?q?o=20hay=20un=20archivo=20para=20enviar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- register.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/register.sh b/register.sh index 7484680..444d65a 100755 --- a/register.sh +++ b/register.sh @@ -16,15 +16,14 @@ while :;do [ -f $install_dir/stop ] && break [ -f $install_dir/lock ] && continue + file=$(get_stack) + [ -z $file ] && continue + ping -c 1 fsf.org > /dev/null 2>&1 || continue test_url="$(curl -s -X POST -o /dev/null -w "%{http_code}" $url)" if [ $test_url -ne 200 ];then echo "$(date +%Y-%m-%d-%H:%M:%S) - $url - $test_url" >> $log && sleep 300 && continue fi - file=$(get_stack) - [ -z $file ] && continue - local_transaction_uuid=$(jq -r '."transaction_uuid"' $stack/$file) - remote_transaction=$(curl -s --connect-timeout 0.9 --show-error -w "~%{http_code}" -X POST -H "Content-Type: application/json" -d @$stack/$file $url 2> $curl_err) remote_response="$(echo $remote_transaction | cut -d '~' -f 1)" server_error="$(echo $remote_transaction | cut -d '~' -f 2)" if [ ${#remote_response} -eq 36 ];then