mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Ignore robots.txt and ynhpanel.js
This commit is contained in:
parent
e7fb9df6b6
commit
8d29c0f507
1 changed files with 15 additions and 1 deletions
|
@ -297,8 +297,16 @@ CHECK_URL () {
|
||||||
# Get all the resources for the main page of the app.
|
# Get all the resources for the main page of the app.
|
||||||
local HTTP_return
|
local HTTP_return
|
||||||
local moved=0
|
local moved=0
|
||||||
|
local ignored=0
|
||||||
while read HTTP_return
|
while read HTTP_return
|
||||||
do
|
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 it's the line with the resource to get
|
||||||
if echo "$HTTP_return" | grep --quiet "^--.*-- http"
|
if echo "$HTTP_return" | grep --quiet "^--.*-- http"
|
||||||
then
|
then
|
||||||
|
@ -310,6 +318,12 @@ CHECK_URL () {
|
||||||
# If the return code is different than 200.
|
# If the return code is different than 200.
|
||||||
if ! echo "$HTTP_return" | grep --quiet "200 OK$"
|
if ! echo "$HTTP_return" | grep --quiet "200 OK$"
|
||||||
then
|
then
|
||||||
|
# Skipped the check of ignored ressources.
|
||||||
|
if [ $ignored -eq 1 ]
|
||||||
|
then
|
||||||
|
ignored=0
|
||||||
|
continue
|
||||||
|
fi
|
||||||
# Isolate the http return code.
|
# Isolate the http return code.
|
||||||
http_code="${HTTP_return##*awaiting response... }"
|
http_code="${HTTP_return##*awaiting response... }"
|
||||||
http_code="${http_code:0:3}"
|
http_code="${http_code:0:3}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue