Changing urls
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 2s

This commit is contained in:
Jose Ivanchechen 2024-12-27 23:32:53 -03:00
parent 9090d6f48a
commit 86d3723128
3 changed files with 7 additions and 6 deletions

View File

@ -2,7 +2,7 @@
### AUTO-UPDATER ### ### AUTO-UPDATER ###
# Variables # Variables
SERVER_FILE="http://h.local/backup.sh" SERVER_FILE="https://git.ivanch.me/ivanch/server-scripts/raw/branch/main/backup.sh"
SERVER_OK=1 SERVER_OK=1
# Check if the server file exists # Check if the server file exists

View File

@ -2,7 +2,7 @@
### AUTO-UPDATER ### ### AUTO-UPDATER ###
# Variables # Variables
SERVER_FILE="http://h.local/clean.sh" SERVER_FILE="https://git.ivanch.me/ivanch/server-scripts/raw/branch/main/clean.sh"
SERVER_OK=1 SERVER_OK=1
# Check if the server file exists # Check if the server file exists

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Usage: # Usage:
## curl -sSL https://git.ivanch.me/ivanch/server-scripts/scripts-download.sh | bash ## curl -sSL https://git.ivanch.me/ivanch/server-scripts/raw/branch/main/scripts-download.sh | bash
# colors # colors
RED='\033[1;31m' RED='\033[1;31m'
@ -13,6 +13,8 @@ LIGHT_GREEN='\033[1;32m'
GREY='\033[1;30m' GREY='\033[1;30m'
YELLOW='\033[1;33m' 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 -ne "\r${LIGHT_BLUE}[i] Running scripts-download.sh"
# Detect OS (Debian or Alpine) # Detect OS (Debian or Alpine)
@ -104,12 +106,11 @@ echo -e "${GREEN}[✓] Crontab is running.${NC}"
# Variables # Variables
FILES=("clean.sh" "backup.sh") FILES=("clean.sh" "backup.sh")
SERVER_URL="http://h.local/"
# 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 "$SERVER_URL/$FILE" | head -n 1 | grep "HTTP/1.[01] [23].." > /dev/null curl -s --head "$FILES_URL/$FILE" | head -n 1 | grep "HTTP/1.[01] [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
@ -123,7 +124,7 @@ echo -e "${GREY}[i] Downloading scripts..."
# Download scripts # Download scripts
for FILE in "${FILES[@]}"; do for FILE in "${FILES[@]}"; do
curl -s -o "./$FILE" "$SERVER_URL/$FILE" curl -s -o "./$FILE" "$FILES_URL/$FILE"
done done
echo -e "${GREEN}[✓] Scripts downloaded.${NC}" echo -e "${GREEN}[✓] Scripts downloaded.${NC}"