From 7d338d727b7063e07eabd4eddd7f6581c844032c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Je=C4=8Dmenica?= <147708271+radovanjecmenica@users.noreply.github.com> Date: Tue, 29 Apr 2025 14:54:27 +0200 Subject: [PATCH] Update UPDATE.sh --- version/1.2.5/UPDATE.sh | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/version/1.2.5/UPDATE.sh b/version/1.2.5/UPDATE.sh index 2fca49e3..da4d03fe 100644 --- a/version/1.2.5/UPDATE.sh +++ b/version/1.2.5/UPDATE.sh @@ -101,25 +101,20 @@ for dir in /home/*/; do echo "→ Modifying $env_file for $user" # Only insert if BACKUP_CPU not already in the file - if ! grep -q "BACKUP_CPU=" "$env_file"; then + if ! grep -q "BACKUP_CPU=" "$env_file"; then awk ' - BEGIN { found = 0 } { - print - if ($0 ~ /^# WEBSERVER$/ && found == 0) { - found = 1 - print "WEB_SERVER=\"nginx\"" - print "HTTP_PORT=\"0:80\"" - print "HTTPS_PORT=\"0:443\"" - print "PROXY_HTTP_PORT=\"\"" - print "" + if ($0 ~ /^# FILE MANAGER$/ && !inserted) { print "# BACKUP" print "BACKUP_CPU=\"1.0\"" print "BACKUP_RAM=\"1.0G\"" + print "" + inserted = 1 } + print } ' "$env_file" > "$env_file.tmp" && mv "$env_file.tmp" "$env_file" - echo " ✔ Backup config inserted after WEBSERVER block" + echo " ✔ Backup config inserted before # FILE MANAGER" else echo " ✔ Backup config already present" fi