mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 13:26:02 +00:00
98_Hyperion: fix for OpenELEC users trying to kill hyperiond.sh
git-svn-id: https://svn.fhem.de/fhem/trunk@12381 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
30debcfb13
commit
39f61a2bb4
@ -226,7 +226,7 @@ sub Hyperion_Read($)
|
|||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $buf = DevIo_SimpleRead($hash);
|
my $buf = DevIo_SimpleRead($hash);
|
||||||
return undef if (!$buf);
|
return undef if (!$buf);
|
||||||
my $result = ($hash->{PARTIAL}) ? $hash->{PARTIAL}.$buf : $buf;
|
my $result = $hash->{PARTIAL}?$hash->{PARTIAL}.$buf:$buf;
|
||||||
$hash->{PARTIAL} = $result;
|
$hash->{PARTIAL} = $result;
|
||||||
return undef if ($buf !~ /(^.+"success":(true|false)\}$)/);
|
return undef if ($buf !~ /(^.+"success":(true|false)\}$)/);
|
||||||
Log3 $name,5,"$name: url ".$hash->{DeviceName}." returned result: $result";
|
Log3 $name,5,"$name: url ".$hash->{DeviceName}." returned result: $result";
|
||||||
@ -512,6 +512,8 @@ sub Hyperion_Set($@)
|
|||||||
my $confdir = AttrVal($name,"hyperionConfigDir","/etc/hyperion/");
|
my $confdir = AttrVal($name,"hyperionConfigDir","/etc/hyperion/");
|
||||||
my $binpath = AttrVal($name,"hyperionBin","/usr/bin/hyperiond");
|
my $binpath = AttrVal($name,"hyperionBin","/usr/bin/hyperiond");
|
||||||
my $bin = (split("/",$binpath))[scalar(split("/",$binpath)) - 1];
|
my $bin = (split("/",$binpath))[scalar(split("/",$binpath)) - 1];
|
||||||
|
$bin =~ s/\.sh$//
|
||||||
|
if ($bin =~ /\.sh$/);
|
||||||
my $user = AttrVal($name,"hyperionSshUser","pi");
|
my $user = AttrVal($name,"hyperionSshUser","pi");
|
||||||
my $ip = $hash->{IP};
|
my $ip = $hash->{IP};
|
||||||
my $sudo = ($user eq "root" || int AttrVal($name,"hyperionNoSudo",0) == 1) ? "" : "sudo ";
|
my $sudo = ($user eq "root" || int AttrVal($name,"hyperionNoSudo",0) == 1) ? "" : "sudo ";
|
||||||
@ -760,7 +762,7 @@ sub Hyperion_Attr(@)
|
|||||||
my ($cmd,$name,$attr_name,$attr_value) = @_;
|
my ($cmd,$name,$attr_name,$attr_value) = @_;
|
||||||
my $hash = $defs{$name};
|
my $hash = $defs{$name};
|
||||||
my $err = undef;
|
my $err = undef;
|
||||||
my $local = ($hash->{IP} eq "localhost" || $hash->{IP} eq "127.0.0.1") ? "" : undef;
|
my $local = ($hash->{IP} =~ /^(localhost|127.0.0.1)$/)?1:undef;
|
||||||
if ($cmd eq "set")
|
if ($cmd eq "set")
|
||||||
{
|
{
|
||||||
if ($attr_name eq "hyperionBin")
|
if ($attr_name eq "hyperionBin")
|
||||||
@ -1050,6 +1052,7 @@ sub Hyperion_devStateIcon($;$)
|
|||||||
<li>
|
<li>
|
||||||
<i>hyperionBin</i><br>
|
<i>hyperionBin</i><br>
|
||||||
path to the hyperion executable<br>
|
path to the hyperion executable<br>
|
||||||
|
OpenELEC users may set hyperiond.sh as executable<br>
|
||||||
default: /usr/bin/hyperiond
|
default: /usr/bin/hyperiond
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user