From c0036d523c3b7acefa5e260695e83b8a74fe1fd3 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 1 Jun 2017 10:15:22 +0200 Subject: [PATCH] Set servername default value in pandora_db script --- pandora_server/util/pandora_db.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index d6960e1d08..036e26828f 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -675,9 +675,13 @@ sub pandora_load_config ($) { $conf->{"dynamic_warning"} = 0.10 unless defined($conf->{"dynamic_warning"}); $conf->{"dynamic_updates"} = 5 unless defined($conf->{"dynamic_updates"}); + $conf->{'servername'} = $conf->{'servername'}; + $conf->{'servername'} = `hostname` unless defined ($conf->{'servername'}); + $conf->{"servername"} =~ s/\s//g; + # workaround for name unconsistency (corresponding entry at pandora_server.conf is 'errorlog_file') - $conf->{'errorlogfile'} = $conf->{'errorlog_file'}; - $conf->{'errorlogfile'} = "/var/log/pandora_server.error" unless defined ($conf->{'errorlogfile'}); + $conf->{'errorlogfile'} = $conf->{'errorlog_file'}; + $conf->{'errorlogfile'} = "/var/log/pandora_server.error" unless defined ($conf->{'errorlogfile'}); # Read additional tokens from the DB my $dbh = db_connect ($conf->{'dbengine'}, $conf->{'dbname'}, $conf->{'dbhost'}, $conf->{'dbport'}, $conf->{'dbuser'}, $conf->{'dbpass'});