From 3fe0bc0a08e10deabb1e8f073766a3b1d258beb3 Mon Sep 17 00:00:00 2001 From: niansa Date: Tue, 3 Jul 2018 16:29:38 +0000 Subject: [PATCH] Update urlcheck.sh --- urlcheck.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/urlcheck.sh b/urlcheck.sh index b0602af..180a75e 100644 --- a/urlcheck.sh +++ b/urlcheck.sh @@ -1,12 +1,12 @@ #! /bin/bash -# Blockiere Versuche, das restliche Dateisystem zu lesen +# Block tries to read documents outside the document root if [[ "$URL" == *..* ]]; then URL='/' FILE="$FILES" fi -# Verhindere "/"-bug +# Avoid a bug if [ -d "$FILE" ]; then if [[ "$URL" != */ ]]; then STATUS='HTTP/1.0 302 Moved permanently @@ -17,26 +17,26 @@ Location: '"${WEBSITE}${URL}"'/' fi fi -# Finde index.html +# Find index.html if [ -f "${FILE}index.html" ]; then URL="${URL}index.html" FILE="${FILE}index.html" fi -# Finde index.php +# Find index.php if [ -f "${FILE}index.php" ]; then URL="${URL}index.php" FILE="${FILE}index.php" fi -# Antworte 404 Not Found wenn Datei nicht existiert +# Answer 404 if the file doesn't exist if [ ! -e "$FILE" ]; then STATUS='HTTP/1.0 404 Not Found' CONTENTTYPE='text/html' FILE="$ERROR404" fi -# Antworte 403 Forbidden wenn Datei nicht lesbar ist +# Answer 403 if the file isn't readable if [ ! -r "$FILE" ]; then STATUS='HTTP/1.0 403 Forbidden' CONTENTTYPE='text/html'