mirror of https://framagit.org/kyodev/kyopages.git
1.5.1
This commit is contained in:
parent
200b045602
commit
98cb4a50cf
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=1.5.0
|
||||
date="30/08/2017"
|
||||
version=1.5.1
|
||||
date="01/09/2017"
|
||||
projet="simpledeb"
|
||||
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
|
||||
script="getIp"
|
||||
|
@ -120,7 +120,7 @@ f__user(){ # v30/08/2017-4
|
|||
|
||||
# test wget, $1 url à tester, sortie script, sur erreur ou retour à la normale
|
||||
# si $2=print affiche url testée & entêtes http & location (si présente) et sortie normale fonction
|
||||
f__wget_test(){ # v30/08/2017
|
||||
f__wget_test(){ # v31/08/2017
|
||||
local file_test_wget retourWget retourHttp location
|
||||
file_test_wget="/tmp/testWget-$RANDOM"
|
||||
wget -Sq --tries=1 --timeout=10 --user-agent="$user_agent" --spider --save-headers "$1" &>"$file_test_wget" || retourWget="$?"
|
||||
|
@ -135,7 +135,7 @@ f__wget_test(){ # v30/08/2017
|
|||
retourHttp="$(grep -i 'HTTP/' "$file_test_wget" | tr -d '\n' | xargs)"
|
||||
location="$(grep -i 'location' $file_test_wget | xargs)"
|
||||
if [ "$2" == "print" ] && [ -z "$retourWget" ]; then
|
||||
echo -e "\n$1"
|
||||
echo -e "\n$BLUE$1"
|
||||
echo "$GREEN$retourHttp$COLOR"
|
||||
[ "$location" ] && echo "$YELLOW$location"
|
||||
echo "$COLOR"
|
||||
|
@ -143,7 +143,7 @@ f__wget_test(){ # v30/08/2017
|
|||
fi
|
||||
if [ "$retourWget" ]; then
|
||||
rm "$file_test_wget"
|
||||
f__error "erreur wget, $retourWget" "url: $1" "$YELLOW$retourHttp" \
|
||||
f__error "erreur wget, $retourWget" "$1" "$YELLOW$retourHttp" \
|
||||
"si persistance, contacter $projet $contact en indiquant les messages précédents"
|
||||
fi
|
||||
if [ "$(grep -c '200' <<< $retourHttp)" -ne 0 ]; then echo -e "$GREEN\ntout est ok, réessayer\n$COLOR"; fi
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
# changelog getIp
|
||||
|
||||
|
||||
## 1.5.1 01/09/2017
|
||||
|
||||
## 1.5.0 30/08/2017
|
||||
* révision mineure f__wget_test
|
||||
|
||||
## 30/08/2017
|
||||
|
||||
* révision f__requis, f__user, f__wget_test, fscript_cronAnacron
|
||||
* révision déclaration local
|
||||
|
|
Loading…
Reference in New Issue