andre 7 mesi fa
parent
commit
bb57e36e8b
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      controllers/SiteController.php

+ 3 - 1
controllers/SiteController.php

@@ -320,7 +320,9 @@ class SiteController {
                 http_response_code(500);
                 echo json_encode(['error' => 'Failed to reload Apache', 'details' => implode("\n", $apacheOutput)]);
                 return;
-            }   
+            }
+            if ($GLOBALS['debug'] == true) { error_log("Remove files of site : " . $domain); }
+            exec("sudo /usr/bin/rm -f /home/$username/$domain 2>&1", $userOutput, $userReturnCode);
         }
         echo json_encode(['success' => 'Undeploy site prod.' . $domain . ' successfully']);
     }