fhem.pl: shutdown: fix for overoptimized browser (Forum #105729)
git-svn-id: https://svn.fhem.de/fhem/trunk@22467 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
11
fhem/fhem.pl
11
fhem/fhem.pl
@@ -1821,6 +1821,17 @@ CommandShutdown($$;$$$)
|
|||||||
|
|
||||||
WriteStatefile();
|
WriteStatefile();
|
||||||
unlink($attr{global}{pidfilename}) if($attr{global}{pidfilename});
|
unlink($attr{global}{pidfilename}) if($attr{global}{pidfilename});
|
||||||
|
|
||||||
|
# Avoid restarts in overoptimized browser #105729
|
||||||
|
doShutdown({p=>$param, e=>$exitValue}) if(!$cl);
|
||||||
|
InternalTimer(time()+1, sub(){doShutdown(@_)}, {p=>$param,e=>$exitValue}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub
|
||||||
|
doShutdown($$)
|
||||||
|
{
|
||||||
|
my ($param, $exitValue) = ($_[0]->{p}, $_[0]->{e});
|
||||||
|
|
||||||
if($param && $param eq "restart") {
|
if($param && $param eq "restart") {
|
||||||
if ($^O !~ m/Win/) {
|
if ($^O !~ m/Win/) {
|
||||||
system("(sleep " . AttrVal("global", "restartDelay", 2) .
|
system("(sleep " . AttrVal("global", "restartDelay", 2) .
|
||||||
|
|||||||
Reference in New Issue
Block a user