From f2358f1530ea6a4a366ea66baaaf90e057a10348 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 21 Mar 2023 18:42:25 +0000 Subject: [PATCH] remove overwrite backup script #1363 [skip ci] --- backup.sh | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/backup.sh b/backup.sh index badb82a0..c6c6ea9a 100755 --- a/backup.sh +++ b/backup.sh @@ -1,33 +1,12 @@ #!/usr/bin/env bash SCRIPT_VERSION="22" -SCRIPT_URL='https://raw.githubusercontent.com/amidaware/tacticalrmm/master/backup.sh' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' RED='\033[0;31m' NC='\033[0m' -THIS_SCRIPT=$(readlink -f "$0") - -TMP_FILE=$(mktemp -p "" "rmmbackup_XXXXXXXXXX") -curl -s -L "${SCRIPT_URL}" >${TMP_FILE} -NEW_VER=$(grep "^SCRIPT_VERSION" "$TMP_FILE" | awk -F'[="]' '{print $3}') - -if [ "${SCRIPT_VERSION}" -ne "${NEW_VER}" ]; then - printf >&2 "${YELLOW}Old backup script detected, downloading and replacing with the latest version...${NC}\n" - wget -q "${SCRIPT_URL}" -O /tmp/backup.sh - if grep -q SCRIPT_VERSION "/tmp/backup.sh"; then - mv /tmp/backup.sh $THIS_SCRIPT - else - printf >&2 "${RED} File Seems to be Corrupt, Please Run this script again.${NC}\n" - rm /tmp/backup.sh - exit - fi - exec ${THIS_SCRIPT} -fi - -rm -f $TMP_FILE if [[ $* == *--schedule* ]]; then ( @@ -35,7 +14,7 @@ if [[ $* == *--schedule* ]]; then echo "0 0 * * * /rmm/backup.sh --auto" ) | crontab - printf >&2 "${GREEN}Backups setup to run at midnight and rotate.${NC}\n" - exit + exit 0 fi if [ $EUID -eq 0 ]; then