fix screen old session termination bug + db.conf rewriting bug
This commit is contained in:
@ -41,21 +41,23 @@ sub notify {
|
||||
sub update_db_config {
|
||||
my ($experiment) = @_;
|
||||
|
||||
open( my $fhandle, '<', $remote_db_conf )
|
||||
open( my $readhandle, '<', $remote_db_conf )
|
||||
or die "failed to open db.conf: $!";
|
||||
my @lines;
|
||||
while ( my $line = <$fhandle> ) {
|
||||
while ( my $line = <$readhandle> ) {
|
||||
if ( $line =~ /^database=/ ) {
|
||||
$line = "database=$db_prefix\_$experiment";
|
||||
}
|
||||
push @lines, $line;
|
||||
}
|
||||
close($fhandle) or die "failed to close db.conf: $!";
|
||||
close($readhandle) or die "failed to close db.conf: $!";
|
||||
|
||||
open( my $fhandle, '>', $remote_db_conf )
|
||||
open( my $writehandle, '>', $remote_db_conf )
|
||||
or die "failed to open db.conf: $!";
|
||||
print( $fhandle, @lines );
|
||||
close($fhandle) or die "failed to close db.conf: $!";
|
||||
print( $writehandle, @lines );
|
||||
close($writehandle) or die "failed to close db.conf: $!";
|
||||
|
||||
say "Updated db.conf for database $db_prefix\_$experiment";
|
||||
}
|
||||
|
||||
sub cpu_count {
|
||||
|
||||
Reference in New Issue
Block a user