Ignore robots.txt and ynhpanel.js

This commit is contained in:
Maniack Crudelis 2017-12-14 01:01:39 +01:00
parent e7fb9df6b6
commit 8d29c0f507

View file

@ -297,8 +297,16 @@ CHECK_URL () {
# Get all the resources for the main page of the app.
local HTTP_return
local moved=0
local ignored=0
while read HTTP_return
do
# Ignore robots.txt and ynhpanel.js. They always redirect to the portal.
if echo "$HTTP_return" | grep --quiet "$check_domain/robots.txt\|$check_domain/ynhpanel.js"; then
ECHO_FORMAT "Ressource ignored:" "white"
ECHO_FORMAT " ${HTTP_return##*http*://}\n"
ignored=1
fi
# If it's the line with the resource to get
if echo "$HTTP_return" | grep --quiet "^--.*-- http"
then
@ -310,6 +318,12 @@ CHECK_URL () {
# If the return code is different than 200.
if ! echo "$HTTP_return" | grep --quiet "200 OK$"
then
# Skipped the check of ignored ressources.
if [ $ignored -eq 1 ]
then
ignored=0
continue
fi
# Isolate the http return code.
http_code="${HTTP_return##*awaiting response... }"
http_code="${http_code:0:3}"