2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-28 02:44:53 +00:00

fhem.pl: shutdown: fix for overoptimized browser (Forum )

git-svn-id: https://svn.fhem.de/fhem/trunk@22467 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2020-07-24 16:37:59 +00:00
parent a610f85a55
commit 0209827d62

@ -1821,6 +1821,17 @@ CommandShutdown($$;$$$)
WriteStatefile();
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 ($^O !~ m/Win/) {
system("(sleep " . AttrVal("global", "restartDelay", 2) .