From dd69c24de16c9223f6d498b6d65e61dafab0164f Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Fri, 24 Jul 2020 16:37:59 +0000 Subject: [PATCH] fhem.pl: shutdown: fix for overoptimized browser (Forum #105729) git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@22467 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fhem.pl b/fhem.pl index cb5eaf218..b81056d44 100755 --- a/fhem.pl +++ b/fhem.pl @@ -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) .