Update HTTP response check
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 2s
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 2s
This commit is contained in:
parent
27b90a9094
commit
56ef66596b
@ -6,7 +6,7 @@ SERVER_FILE="https://git.ivanch.me/ivanch/server-scripts/raw/branch/main/backup.
|
||||
SERVER_OK=1
|
||||
|
||||
# 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
|
||||
echo "Error: $SERVER_FILE not found." >&2
|
||||
|
2
clean.sh
2
clean.sh
@ -6,7 +6,7 @@ SERVER_FILE="https://git.ivanch.me/ivanch/server-scripts/raw/branch/main/clean.s
|
||||
SERVER_OK=1
|
||||
|
||||
# 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
|
||||
echo "Error: $SERVER_FILE not found." >&2
|
||||
|
@ -15,7 +15,7 @@ YELLOW='\033[1;33m'
|
||||
|
||||
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)
|
||||
echo -e "${GREY}[i] Detecting OS..."
|
||||
@ -110,7 +110,7 @@ FILES=("clean.sh" "backup.sh")
|
||||
# Check connection with the server for all files
|
||||
echo -e "${GREY}[i] Checking connection with the server..."
|
||||
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
|
||||
echo -e "${RED}[x] Error: $FILE not found on the server.${NC}" >&2
|
||||
|
Loading…
x
Reference in New Issue
Block a user