2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-04 11:26:55 +00:00

FRITZBOX: no root user -> remote mode

git-svn-id: https://svn.fhem.de/fhem/trunk@8838 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
tpoitzsch 2015-06-26 20:44:16 +00:00
parent 7592a96331
commit 10a462f0e9

View File

@ -184,21 +184,16 @@ sub FRITZBOX_Define($$)
}
# unless (qx ( [ -f /usr/bin/ctlmgr_ctl ] && echo 1 || echo 0 ))
unless ( -X "/usr/bin/ctlmgr_ctl" )
{
unless ( -X "/usr/bin/ctlmgr_ctl" ) {
$hash->{REMOTE} = 1;
FRITZBOX_Log $hash, 4, "FRITZBOX runs in remote mode";
}
elsif ( $< != 0 )
{
$msg = "Error - FHEM is not running under root (currently " .
( getpwuid( $< ) )[ 0 ] .
") but we need to be root";
FRITZBOX_Log $hash, 1, $msg;
return $msg;
elsif ( $< != 0 ) {
FRITZBOX_Log $hash, 3, "FHEM is not running under root user (currently " .
( getpwuid( $< ) )[ 0 ] . "). FRITZBOX runs in remote mode.";
$hash->{REMOTE} = 1;
}
else
{
else {
$hash->{REMOTE} = 0;
FRITZBOX_Log $hash, 4, "FRITZBOX runs in local mode";
}