This commit is contained in:
kyodev 2017-07-26 21:21:34 +02:00
parent a3dc2bf234
commit 4cfee6af07
1 changed files with 7 additions and 6 deletions

View File

@ -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