From 7e2f6a5ea7fdc78073b249fd30e94d05a49b7ac4 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Mon, 21 Jul 2025 00:52:40 +0500 Subject: [PATCH] bug fix: https://github.com/usmannasir/cyberpanel/issues/1449 --- websiteFunctions/website.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index 8f5c979e2..630e2f56a 100644 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -2825,15 +2825,14 @@ Require valid-user command = f"mkdir -p {dirPath}" ProcessUtilities.executioner(command) - # Write the HTML content to a temporary file first - tempFile = "/tmp/suspension_temp.html" - # Use cat with heredoc to create the file - command = f'''cat > {tempFile} << 'EOF' -{defaultSuspensionHTML} -EOF''' - ProcessUtilities.executioner(command, shell=True) + # Write the HTML content to a temporary file in /home/cyberpanel + tempFile = "/home/cyberpanel/suspension_temp.html" - # Move the temporary file to the final location + # Create the file using normal Python file operations + with open(tempFile, 'w') as f: + f.write(defaultSuspensionHTML) + + # Use ProcessUtilities to move the file to the final location command = f"mv {tempFile} {suspensionPagePath}" ProcessUtilities.executioner(command) except: