add newline to db.conf updater

This commit is contained in:
2026-04-17 22:21:48 +02:00
parent 52e766e1c2
commit c3ada55395

View File

@ -44,14 +44,19 @@ sub update_db_config {
open( my $readhandle, '<', $remote_db_conf )
or die "failed to open db.conf: $!";
my @lines;
my $found = 0;
while ( my $line = <$readhandle> ) {
if ( $line =~ /^database=/ ) {
$line = "database=$db_prefix\_$experiment";
$line = "database=${db_prefix}_$experiment\n";
$found = 1;
}
push @lines, $line;
}
close($readhandle) or die "failed to close db.conf: $!";
die "no database= line found in $remote_db_conf for some reason"
unless $found;
open( my $writehandle, '>', $remote_db_conf )
or die "failed to open db.conf: $!";
print( $writehandle, @lines );