Hallo,
die Sub ShutdownWindows funktioniert, beim Aufruf von ShutdownLinux bekomme ich jedoch folgende Meldung:
Can't use string ("my-pc2") as an ARRAY ref while "strict refs" in use at ./FHEM/99_myUtils.pm line
Meine Subs:
###############################################################################
# Shutdown Windows-PC
###############################################################################
sub ShutdownWindows
{
my $pc = $_[0];
`net rpc shutdown -C \"Shutdown durch FHEM\" -S $pc -U DOMAIN/Backup%Password -f -t 5`;
}
###############################################################################
# Shutdown Linux-PC
###############################################################################
sub ShutdownLinux
{
my $pc = $_[0];
`ssh -tt ausschalten@$pc 'sudo shutdown -h now'`;
}
Der Aufruf aus dem WOL Modul erfolgt so:
shutdownCmd {ShutdownLinux("my-pc2")}
Lass einfach das [ 0 ] weg......
Und das `net rpc shutdown -C \"Shutdown durch FHEM\" -S $pc -U DOMAIN/Backup%Password -f -t 5`;
musst als system-Befehl aufrufen
also system("net rpc shutdown -C \"Shutdown durch FHEM\" -S $pc -U DOMAIN/Backup%Password -f -t 5");
Danke