Skip to content

Commit be0aebe

Browse files
committed
Delete site certs
1 parent 07dc733 commit be0aebe

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Site_Command.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,17 @@ private function delete_site() {
892892
}
893893

894894
if ( $this->level > 4 ) {
895+
if ( $this->le ) {
896+
EE::log( 'Removing ssl certs.' );
897+
$crt_file = EE_CONF_ROOT . "/nginx/certs/$this->site_name.crt";
898+
$key_file = EE_CONF_ROOT . "/nginx/certs/$this->site_name.key";
899+
if ( file_exists( $crt_file ) ) {
900+
unlink( $crt_file );
901+
}
902+
if ( file_exists( $key_file ) ) {
903+
unlink( $key_file );
904+
}
905+
}
895906
if ( $this->db::delete( array( 'sitename' => $this->site_name ) ) ) {
896907
EE::log( 'Removing database entry.' );
897908
} else {

0 commit comments

Comments
 (0)