Update HTTP response check
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 2s

This commit is contained in:
Jose Henrique 2024-12-27 23:44:46 -03:00
parent 27b90a9094
commit 56ef66596b
3 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ SERVER_FILE="https://git.ivanch.me/ivanch/server-scripts/raw/branch/main/backup.
SERVER_OK=1 SERVER_OK=1
# Check if the server file exists # Check if the server file exists
curl -s --head $SERVER_FILE | head -n 1 | grep "HTTP/1.[01] [23].." > /dev/null curl -s --head $SERVER_FILE | head -n 1 | grep -E "HTTP/[12] [23].." > /dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Error: $SERVER_FILE not found." >&2 echo "Error: $SERVER_FILE not found." >&2

View File

@ -6,7 +6,7 @@ SERVER_FILE="https://git.ivanch.me/ivanch/server-scripts/raw/branch/main/clean.s
SERVER_OK=1 SERVER_OK=1
# Check if the server file exists # Check if the server file exists
curl -s --head $SERVER_FILE | head -n 1 | grep "HTTP/1.[01] [23].." > /dev/null curl -s --head $SERVER_FILE | head -n 1 | grep -E "HTTP/[12] [23].." > /dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Error: $SERVER_FILE not found." >&2 echo "Error: $SERVER_FILE not found." >&2

View File

@ -15,7 +15,7 @@ YELLOW='\033[1;33m'
FILES_URL="https://git.ivanch.me/ivanch/server-scripts/raw/branch/main" FILES_URL="https://git.ivanch.me/ivanch/server-scripts/raw/branch/main"
echo -ne "\r${LIGHT_BLUE}[i] Running scripts-download.sh" echo -e "\r${LIGHT_BLUE}[i] Running scripts-download.sh"
# Detect OS (Debian or Alpine) # Detect OS (Debian or Alpine)
echo -e "${GREY}[i] Detecting OS..." echo -e "${GREY}[i] Detecting OS..."
@ -110,7 +110,7 @@ FILES=("clean.sh" "backup.sh")
# Check connection with the server for all files # Check connection with the server for all files
echo -e "${GREY}[i] Checking connection with the server..." echo -e "${GREY}[i] Checking connection with the server..."
for FILE in "${FILES[@]}"; do for FILE in "${FILES[@]}"; do
curl -s --head "$FILES_URL/$FILE" | head -n 1 | grep "HTTP/1.[01] [23].." > /dev/null curl -s --head "$FILES_URL/$FILE" | head -n 1 | grep -E "HTTP/[12] [23].." > /dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo -e "${RED}[x] Error: $FILE not found on the server.${NC}" >&2 echo -e "${RED}[x] Error: $FILE not found on the server.${NC}" >&2