From a88abc176cf69ec95937d3292773c99f8e8292fe Mon Sep 17 00:00:00 2001 From: usmannasir Date: Wed, 2 Jul 2025 15:23:21 +0500 Subject: [PATCH] design/font improvements to backup pages --- plogical/upgrade.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 5caf7e194..545ea7b30 100644 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -3739,8 +3739,8 @@ pm.max_spare_servers = 3 try: shutil.copy(backup_file, file) print(f"Restored: {file}") - except: - pass + except Exception as e: + print(f"Failed to restore {file}: {str(e)}") else: print(f"Backup not found for: {file}") @@ -3750,17 +3750,19 @@ pm.max_spare_servers = 3 execPath = "sudo /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/csf.py" execPath = execPath + " removeCSF" - Upgrade.executioner(execPath, 'fix csf if there', 0) + Upgrade.executioner(execPath, 'Remove CSF before reinstall', 0) execPath = "sudo /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/csf.py" execPath = execPath + " installCSF" + Upgrade.executioner(execPath, 'Install CSF', 0) - # Restore the files - print("Restoring files...") + # Restore the files AFTER installation + print("Restoring CSF configuration files...") restore_files() - - - Upgrade.executioner(execPath, 'fix csf if there', 0) + + # Restart CSF to apply restored configuration + command = 'csf -r' + Upgrade.executioner(command, 'Restart CSF with restored config', 0)