From 7fe1c62549265697ac6d0d0ae29f59d4db73932e Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Thu, 27 Feb 2025 13:44:04 +0500 Subject: [PATCH] Add if exists folder backup --- off_configure_zaprets.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/off_configure_zaprets.sh b/off_configure_zaprets.sh index a4f5953..baf7919 100644 --- a/off_configure_zaprets.sh +++ b/off_configure_zaprets.sh @@ -7,14 +7,16 @@ config_files="dhcp youtubeUnblock https-dns-proxy" -echo "Restore configs..." +if [ -d "$DIR_BACKUP" ] +then + echo "Restore configs..." + for file in $config_files + do + cp -f "$DIR_BACKUP/$file" "$DIR/$file" + done -for file in $config_files -do - cp -f "$DIR_BACKUP/$file" "$DIR/$file" -done - -rm -rf "$DIR_BACKUP" + rm -rf "$DIR_BACKUP" +fi echo "Restart service..." @@ -29,4 +31,4 @@ grep -v "0 4 \* \* \* wget -O - $URL/configure_zaprets.sh | sh" /etc/crontabs/ro cp -f "/etc/crontabs/temp" "/etc/crontabs/root" rm -f "/etc/crontabs/temp" -echo "Off configure complete..." +printf "\033[32;1mOff configured completed...\033[0m"