2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-23 08:36:24 +00:00

fixing non-root check; set state to disabled, when reconnecting to presenced/collectord and device is disabled

git-svn-id: https://svn.fhem.de/fhem/trunk@2819 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch 2013-02-26 21:57:48 +00:00
parent ecebff33a9
commit 8f201f6c41

View File

@ -118,7 +118,7 @@ PRESENCE_Define($$)
return $msg; return $msg;
} }
if(-X "/usr/bin/ctlmgr_ctl" and $destination eq "fritzbox" or $destination eq "lan-ping" and not $< == 0) if(-X "/usr/bin/ctlmgr_ctl" and ($destination eq "fritzbox" or $destination eq "lan-ping") and not $< == 0)
{ {
my $msg = "FHEM is not running under root (currently ".(getpwuid($<))[0].") This check can only performed with root access to the FritzBox"; my $msg = "FHEM is not running under root (currently ".(getpwuid($<))[0].") This check can only performed with root access to the FritzBox";
@ -355,8 +355,14 @@ PRESENCE_DoInit($)
my ($hash) = @_; my ($hash) = @_;
DevIo_SimpleWrite($hash, $hash->{ADDRESS}."|".$hash->{TIMEOUT}."\n", 0) unless($hash->{helper}{DISABLED}); unless($hash->{helper}{DISABLED})
{
DevIo_SimpleWrite($hash, $hash->{ADDRESS}."|".$hash->{TIMEOUT}."\n", 0);
}
else
{
readingsSingleUpdate($hash, "state", "disabled",1);
}
} }