2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

fhem.pl: display warning message on config error, see forum#22105

git-svn-id: https://svn.fhem.de/fhem/trunk@5413 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-04-02 11:05:28 +00:00
parent 4fe3969988
commit 29ea83623e

View File

@ -433,20 +433,31 @@ while(time() < 2*3600) {
sleep(5);
}
my $cfgErrMsg = "There were error messages while initializing FHEM";
my $cfgRet="";
if($attr{global}{configfile} eq 'configDB') {
my $ret = cfgDB_ReadAll(undef);
Log 1, "configDB: $ret" if($ret);
$cfgRet .= "configDB: $ret" if($ret);
} else {
my $ret = CommandInclude(undef, $attr{global}{configfile});
Log 1, "configfile: $ret" if($ret);
$cfgRet .= "configfile: $ret\n" if($ret);
if($attr{global}{statefile} && -r $attr{global}{statefile}) {
$ret = CommandInclude(undef, $attr{global}{statefile});
Log 1, "statefile: $ret" if($ret);
$cfgRet .= "statefile: $ret" if($ret);
}
}
if($cfgRet) {
$attr{global}{motd} = "$cfgErrMsg,\ncheck the Logfile for details.";
Log 1, $cfgRet;
} elsif($attr{global}{motd} =~ m/^$cfgErrMsg/) {
$attr{global}{motd} = "";
}
SignalHandling();
my $pfn = $attr{global}{pidfilename};