From 86d37231283d585115e86b04eaa2a9a4b991e73c Mon Sep 17 00:00:00 2001 From: Jose Ivanchechen Date: Fri, 27 Dec 2024 23:32:53 -0300 Subject: [PATCH] Changing urls --- backup.sh | 2 +- clean.sh | 2 +- scripts-download.sh | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/backup.sh b/backup.sh index b307a57..6f2e36b 100644 --- a/backup.sh +++ b/backup.sh @@ -2,7 +2,7 @@ ### AUTO-UPDATER ### # 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 # Check if the server file exists diff --git a/clean.sh b/clean.sh index 15a3815..3b50e94 100644 --- a/clean.sh +++ b/clean.sh @@ -2,7 +2,7 @@ ### AUTO-UPDATER ### # 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 # Check if the server file exists diff --git a/scripts-download.sh b/scripts-download.sh index 039b36c..90cfc59 100644 --- a/scripts-download.sh +++ b/scripts-download.sh @@ -1,7 +1,7 @@ #!/bin/bash # 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 RED='\033[1;31m' @@ -13,6 +13,8 @@ LIGHT_GREEN='\033[1;32m' GREY='\033[1;30m' 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" # Detect OS (Debian or Alpine) @@ -104,12 +106,11 @@ echo -e "${GREEN}[✓] Crontab is running.${NC}" # Variables FILES=("clean.sh" "backup.sh") -SERVER_URL="http://h.local/" # 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 "$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 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 for FILE in "${FILES[@]}"; do - curl -s -o "./$FILE" "$SERVER_URL/$FILE" + curl -s -o "./$FILE" "$FILES_URL/$FILE" done echo -e "${GREEN}[✓] Scripts downloaded.${NC}"