From 4cfee6af07b21cf42fb6528f27a8e7f72f960fa1 Mon Sep 17 00:00:00 2001 From: kyodev Date: Wed, 26 Jul 2017 21:21:34 +0200 Subject: [PATCH] 1.2.0 --- scripts/diag_getFirefox | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/diag_getFirefox b/scripts/diag_getFirefox index a792b57..0e4267c 100755 --- a/scripts/diag_getFirefox +++ b/scripts/diag_getFirefox @@ -1,22 +1,23 @@ #!/bin/bash +# mise à jour 26/07/2017 + user_agent="Mozilla/5.0 (X11; Linux $(uname -m); rv:54.0) Gecko/20100101 Firefox/54.0" file_tempo_test="tempoTest-$RANDOM" # test wget, $1 url à tester, $2 objet, affiche url testée & entêtes http & location -f__wget_entete(){ +f__wget_entete_diag(){ wget -Sq --tries=1 --timeout=10 --user-agent="$user_agent" --spider --save-headers "$1" &>$file_tempo_test - http="$(grep -i 'HTTP/' $file_tempo_test)" + local http="$(grep -i 'HTTP/' $file_tempo_test)" http=" $(echo $http | tr -d '\n')" - location="$(grep -i 'location' $file_tempo_test)" + local location="$(grep -i 'location' $file_tempo_test)" echo "$2: $1" echo "$http" echo "$http" | grep '40' &>/dev/null && echo " ERREUR 404" || echo "$location" } for architecture in linux linux64; do - echo "" - echo "Architecture: $architecture" + echo -e "\nArchitecture: $architecture" echo "=====================" for product in latest esr beta dev nightly; do if [ "$product" == "latest" ]; then @@ -29,7 +30,7 @@ for architecture in linux linux64; do recup_url="https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=$architecture&lang=fr" elif [ "$product" == "nightly" ]; then recup_url="https://download.mozilla.org/?product=firefox-$product-latest-l10n-ssl&os=$architecture&lang=fr" ;fi - f__wget_entete "$recup_url" "$product" + f__wget_entete_diag "$recup_url" "$product" done done