Skip to content

Commit

Permalink
Update DirectorPatch.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
garrynewman committed Jun 3, 2020
1 parent 5aae0af commit 31b2610
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions UI/DirectorPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ bool PatchDirector( LogWindow log )
log.WriteNormal( $" Reading Certs/public.pem\n" );
var localCert = System.IO.File.ReadAllText( "Certs/public.pem" );

var localBackupName = $"Certs/clientca-prod.{DateTime.Now.ToString( "yyyy-dd-M--HH-mm-ss" )}.backup";
log.WriteNormal( $" Downloading to {localBackupName}\n" );
System.IO.File.WriteAllText( localBackupName, certificate );

if ( certificate.Contains( localCert ) )
{
log.WriteError( $"The certificate on the director already contains our public key!\n" );
Expand All @@ -170,8 +174,9 @@ bool PatchDirector( LogWindow log )
//
// This serves no purpose but it doesn't hurt to have it hanging around
//
log.WriteNormal( $" Downloading to Certs/clientca-prod.pem\n" );
System.IO.File.WriteAllText( "Certs/clientca-prod.pem", certificate );
localBackupName += ".new";
log.WriteNormal( $" Downloading to {localBackupName}\n" );
System.IO.File.WriteAllText( localBackupName, certificate );


//
Expand Down

0 comments on commit 31b2610

Please sign in to comment.