Compare commits
3 commits
8df59231a5
...
676b3628bb
Author | SHA1 | Date | |
---|---|---|---|
|
676b3628bb | ||
|
46541ea34d | ||
|
303e35b075 |
2 changed files with 5 additions and 4 deletions
|
@ -48,6 +48,6 @@ json="{\"transaction_uuid\":\"$uuid\",\"controller_id\":\"$name\",\"timestamp\":
|
|||
if echo $json | $json_linter >/dev/null 2>&1 ;then
|
||||
echo $json > $install_dir/stack/$file && rm $install_dir/lock && echo $((counter+1)) > $install_dir/counter && break
|
||||
else
|
||||
echo "$(date +%Y-%m-%d-%H:%M:%S) - No se pudo obtener información." >> $install_dir/errors.log && sleep 1
|
||||
echo "$(date +%Y-%m-%d-%H:%M:%S) - No se pudo obtener información." >> $log && sleep 1
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -13,16 +13,17 @@ for filename in $install_dir/stack/*;do
|
|||
done
|
||||
|
||||
while :;do
|
||||
[ -f $install_dir/lock ] && 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 -eq 404 ];then
|
||||
echo "$(date +%Y-%m-%d-%H:%M:%S) - $url - $test_url" >> $install_dir/errors.log && sleep 300 && continue
|
||||
echo "$(date +%Y-%m-%d-%H:%M:%S) - $url - $test_url" >> $log && sleep 300 && continue
|
||||
fi
|
||||
[ -f $install_dir/lock ] && continue
|
||||
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_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
|
||||
|
|
Loading…
Reference in a new issue