From 508ae386faa7f7b4b864b55424f03d26d7da79e4 Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Sun, 25 Mar 2018 18:11:00 +0000 Subject: [PATCH] configDB.pm: move rescue modes from ENV to config file git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@16485 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- configDB.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/configDB.pm b/configDB.pm index 21a23fd72..7b1b4d3e1 100644 --- a/configDB.pm +++ b/configDB.pm @@ -246,9 +246,13 @@ if($cfgDB_dbconn =~ m/pg:/i) { $cfgDB_dbtype = "unknown"; } -$configDB{attr}{nostate} = 1 if($ENV{'cfgDB_nostate'}); -$configDB{attr}{rescue} = 1 if($ENV{'cfgDB_rescue'}); -$configDB{attr}{loadversion} = $ENV{'cfgDB_version'} ? $ENV{'cfgDB_version'} : 0; +#$configDB{attr}{nostate} = 1 if($ENV{'cfgDB_nostate'}); +#$configDB{attr}{rescue} = 1 if($ENV{'cfgDB_rescue'}); +#$configDB{attr}{loadversion} = $ENV{'cfgDB_version'} ? $ENV{'cfgDB_version'} : 0; + +$configDB{attr}{nostate} = defined($dbconfig{nostate}) ? $dbconfig{nostate} : 0; +$configDB{attr}{rescue} = defined($dbconfig{rescue}) ? $dbconfig{rescue} : 0; +$configDB{attr}{loadversion} = defined($dbconfig{loadversion}) ? $dbconfig{loadversion} : 0; ################################################## # Basic functions needed for DB configuration @@ -461,7 +465,7 @@ sub cfgDB_ReadAll($) { my ($cl) = @_; my ($ret, @dbconfig); - if (defined($configDB{attr}{rescue}) && ($configDB{attr}{rescue} == 1)) { + if ($configDB{attr}{rescue} == 1) { Log (0, 'configDB starting in rescue mode!'); push (@dbconfig, 'attr global modpath .'); push (@dbconfig, 'attr global verbose 3'); @@ -472,7 +476,7 @@ sub cfgDB_ReadAll($) { # add Config Rows to commandfile @dbconfig = _cfgDB_ReadCfg(@dbconfig); # add State Rows to commandfile - @dbconfig = _cfgDB_ReadState(@dbconfig) unless $configDB{attr}{nostate}; + @dbconfig = _cfgDB_ReadState(@dbconfig) unless $configDB{attr}{nostate} == 1; } # AnalyzeCommandChain for all entries