mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
FRITZBOX: get shellCommand
git-svn-id: https://svn.fhem.de/fhem/trunk@7795 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
761f00a17d
commit
271f779726
@ -131,7 +131,8 @@ sub FRITZBOX_Initialize($)
|
||||
$hash->{SetFn} = "FRITZBOX_Set";
|
||||
$hash->{GetFn} = "FRITZBOX_Get";
|
||||
$hash->{AttrFn} = "FRITZBOX_Attr";
|
||||
$hash->{AttrList} = "disable:0,1 "
|
||||
$hash->{AttrList} = "allowShellCommand:0,1 "
|
||||
."disable:0,1 "
|
||||
."defaultCallerName "
|
||||
."defaultUploadDir "
|
||||
."fritzBoxIP "
|
||||
@ -418,7 +419,7 @@ sub FRITZBOX_Set($$@)
|
||||
##########################################
|
||||
sub FRITZBOX_Get($@)
|
||||
{
|
||||
my ($hash, $name, $cmd) = @_;
|
||||
my ($hash, $name, $cmd, @val) = @_;
|
||||
my $returnStr;
|
||||
|
||||
if (lc $cmd eq "ringtones")
|
||||
@ -428,8 +429,14 @@ sub FRITZBOX_Get($@)
|
||||
$returnStr .= join "\n", sort values %ringTone;
|
||||
return $returnStr;
|
||||
}
|
||||
|
||||
elsif ( lc $cmd eq "shellcommand" && int @val && AttrVal( $name, "allowShellCommand", 0 ) )
|
||||
{
|
||||
my $shCmd = join " ", @val;
|
||||
return FRITZBOX_Exec( $hash, $shCmd );
|
||||
}
|
||||
my $list = "ringTones:noArg";
|
||||
$list .= " shellCommand"
|
||||
if AttrVal( $name, "allowShellCommand", 0 );
|
||||
return "Unknown argument $cmd, choose one of $list";
|
||||
} # end FRITZBOX_Get
|
||||
|
||||
@ -2676,13 +2683,26 @@ sub FRITZBOX_fritztris($)
|
||||
<br>
|
||||
Shows the list of ring tones that can be used.
|
||||
</li><br>
|
||||
|
||||
<li><code>get <name> shellCommand <Command></code>
|
||||
<br>
|
||||
Runs the given command on the Fritz!Box shell and returns the result.
|
||||
Can be used to run shell commands not included in this modul.
|
||||
<br>
|
||||
Only available if the attribute "allowShellCommand" is set.
|
||||
</li><br>
|
||||
</ul>
|
||||
|
||||
<a name="FRITZBOXattr"></a>
|
||||
<b>Attributes</b>
|
||||
<ul>
|
||||
<br>
|
||||
<li><code>defaultCallerName</code>
|
||||
<li><code>allowShellCommand <0 | 1></code>
|
||||
<br>
|
||||
Enables the get command "shellCommand"
|
||||
</li><br>
|
||||
|
||||
<li><code>defaultCallerName <Text></code>
|
||||
<br>
|
||||
The default text to show on the ringing phone as 'caller'.
|
||||
<br>
|
||||
@ -2698,7 +2718,7 @@ sub FRITZBOX_fritztris($)
|
||||
It needs to be the name of the path on the Fritz!Box. So, it should start with /var/InternerSpeicher if it equals in Windows \\ip-address\fritz.nas
|
||||
</li><br>
|
||||
|
||||
<li><code>fritzBoxIP</code>
|
||||
<li><code>fritzBoxIP <IP Address></code>
|
||||
<br>
|
||||
IP address or URL of the Fritz!Box for remote telnet access. Default is "fritz.box".
|
||||
</li><br>
|
||||
@ -2940,13 +2960,26 @@ sub FRITZBOX_fritztris($)
|
||||
<br>
|
||||
Zeigt die Liste der Klingeltöne, die benutzt werden können.
|
||||
</li><br>
|
||||
|
||||
<li><code>get <name> shellCommand <Befehl></code>
|
||||
<br>
|
||||
Führt den angegebenen Befehl auf der Fritz!Box-Shell aus und gibt das Ergebnis zurück.
|
||||
Kann benuzt werden, um Shell-Befehle auszuführen, die nicht im Modul implementiert sind.
|
||||
<br>
|
||||
Muss zuvor über das Attribute "allowShellCommand" freigeschaltet werden.
|
||||
</li><br>
|
||||
</ul>
|
||||
|
||||
<a name="FRITZBOXattr"></a>
|
||||
<b>Attributes</b>
|
||||
<ul>
|
||||
<br>
|
||||
<li><code>defaultCallerName</code>
|
||||
<li><code>allowShellCommand <0 | 1></code>
|
||||
<br>
|
||||
Freischalten des get-Befehls "shellCommand"
|
||||
</li><br>
|
||||
|
||||
<li><code>defaultCallerName <Text></code>
|
||||
<br>
|
||||
Standard-Text, der auf dem angerufenen internen Telefon als "Anrufer" gezeigt wird.
|
||||
<br>
|
||||
@ -2962,7 +2995,7 @@ sub FRITZBOX_fritztris($)
|
||||
Es muss ein Pfad auf der Fritz!Box sein. D.h., er sollte mit /var/InternerSpeicher starten, wenn es in Windows unter \\ip-address\fritz.nas erreichbar ist.
|
||||
</li><br>
|
||||
|
||||
<li><code>fritzBoxIP</code>
|
||||
<li><code>fritzBoxIP <IP-Adresse></code>
|
||||
<br>
|
||||
IP Adresse oder ULR der Fritz!Box für Fernzugriff per Telnet. Standard ist "fritz.box".
|
||||
</li><br>
|
||||
|
Loading…
x
Reference in New Issue
Block a user