2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

fixed a bug in update.pm

git-svn-id: https://svn.fhem.de/fhem/trunk@2580 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mfr69bs 2013-01-27 18:02:37 +00:00
parent 2e49d2629e
commit cc0eecb116

View File

@ -58,19 +58,6 @@ CommandUpdate($$)
my $force = 0;
my $ret = "";
# check for fheminfo settings
my $sendStatistics = AttrVal("global","sendStatistics",undef);
if(!defined($sendStatistics) ||
( defined($sendStatistics) &&
lc($sendStatistics) ne "onupdate" ||
lc($sendStatistics) ne "manually" ||
lc($sendStatistics) ne "never" )
) {
$ret = optInFhemInfo();
Log 1,"update Action required: please run 'update viewAdvice'";
return $ret;
}
# split arguments
my @args = split(/ +/,$param);
@ -103,6 +90,19 @@ CommandUpdate($$)
return $ret;
}
# check for fheminfo settings
my $sendStatistics = AttrVal("global","sendStatistics",undef);
if(!defined($sendStatistics) ||
( defined($sendStatistics) &&
lc($sendStatistics) ne "onupdate" &&
lc($sendStatistics) ne "manually" &&
lc($sendStatistics) ne "never" )
) {
$ret = optInFhemInfo();
Log 1,"update Action required: please run 'update viewAdvice'";
return $ret;
}
# check arguments
if (defined($args[1]) && $args[1] eq "?" ||
(int(@args) > 3 && uc($args[1]) eq "HOUSEKEEPING") ||
@ -146,7 +146,7 @@ CommandUpdate($$)
$ret = update_DoUpdate($srcdir,$BRANCH,$update,$force,$cl);
if(lc($sendStatistics) eq "onupdate") {
$ret .= "\n\n";
$ret .= CommandFheminfo(undef,"send");
$ret .= AnalyzeCommandChain(undef, "fheminfo send");
}
}