From a81661f8e34707ed2b79e507f439b98c4eefc36c Mon Sep 17 00:00:00 2001
From: rudolfkoenig <>
Date: Thu, 7 Jul 2011 08:46:28 +0000
Subject: [PATCH] shutdown/rereadcfg added
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@932 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
docs/commandref.html | 4 ++--
fhem.pl | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/docs/commandref.html b/docs/commandref.html
index 1376766cd..d493bed49 100644
--- a/docs/commandref.html
+++ b/docs/commandref.html
@@ -706,7 +706,7 @@ A line ending with \ will be concatenated with the next one, so long lines
Re-read the configuration file.
Note: The statefile will be saved first, then the config file will be read
(all devices will be initialized again), and at last the statefile will be
- reloaded.
+ reloaded. It triggers upon completion the global:REREADCFG event.
Example:
@@ -783,7 +783,7 @@ A line ending with \ will be concatenated with the next one, so long lines
shutdown
Shut down the server (after saving the state information
- )
+ ). It triggers the global:SHUTDOWN event.
Example:
diff --git a/fhem.pl b/fhem.pl
index eb47ff34d..d46710599 100755
--- a/fhem.pl
+++ b/fhem.pl
@@ -167,7 +167,7 @@ my $nextat; # Time when next timer will be triggered.
my $intAtCnt=0;
my %duplicate; # Pool of received msg for multi-fhz/cul setups
my $duplidx=0; # helper for the above pool
-my $cvsid = '$Id: fhem.pl,v 1.144 2011-06-19 06:17:27 rudolfkoenig Exp $';
+my $cvsid = '$Id: fhem.pl,v 1.145 2011-07-07 08:46:28 rudolfkoenig Exp $';
my $namedef =
"where is either:\n" .
"- a single device name\n" .
@@ -912,6 +912,7 @@ CommandRereadCfg($$)
if(!$ret && $attr{global}{statefile} && -r $attr{global}{statefile}) {
$ret = CommandInclude($cl, $attr{global}{statefile});
}
+ DoTrigger("global", "REREADCFG");
$reread_active=0;
return $ret;
@@ -1021,6 +1022,7 @@ sub
CommandShutdown($$)
{
my ($cl, $param) = @_;
+ DoTrigger("global", "SHUTDOWN");
Log 0, "Server shutdown";
foreach my $d (sort keys %defs) {