Thread Wie funktioniert Net::Fritz::ConfigFile? (7 answers)
Opened by bianca at 2021-01-19 11:49

bianca
 2021-01-19 11:49
#193098 #193098
User since
2009-09-13
6975 Artikel
BenutzerIn

user image
Grüß Gott!

Ich versuche die Konfigurationsdatei meiner FRITZ!Box (mit der ersten Zeile **** FRITZ!Box 7490 CONFIGURATION EXPORT) zu lesen/laden, um sie zu backup'en.

Mein Versuch:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl
use strict;
use warnings;
use Fcntl qw(:DEFAULT :flock);
use Data::Dumper;
local $Data::Dumper::Purity;$Data::Dumper::Purity = 1;
local $Data::Dumper::Useqq;$Data::Dumper::Useqq = 1;
local $Data::Dumper::Deparse = 1;$Data::Dumper::Deparse = 1;
local $Data::Dumper::Sortkeys;$Data::Dumper::Sortkeys = sub {
    my ($hash) = @_;
    return [(sort {lc $a cmp lc $b} keys %$hash)]; 
};
use 5.010;
system('cls');

require Net::Fritz::Box;

my $host = 'https://192.168.0.1:49443';
my $username = "uname";              # Username for scripting at FritzBox
my $password = "upsw";      # Username's password at FritzBox

my $config = Net::Fritz::ConfigFile->new(
    username => $username,
    password => $password,
    upnp_url => $host,
);

my $config_hashref = $config->configuration;

say Dumper($config_hashref);

Ergebnis ist leider nur
Quote
$VAR1 = {};

Was mache ich falsch? Ist das überhaupt der richtige Ansatz? Ich kann in der Doku zu CPAN:Net::Fritz::ConfigFile keinen eindeutigen Hinweis finden, ob das nur zum lesen und/oder schreiben der Konfig dient.
Mir geht es um die Konfig, die man über das Menü System --> Sicherung runterladen und auch hochladen kann.

Bedanke mich.
10 print "Hallo"
20 goto 10

View full thread Wie funktioniert Net::Fritz::ConfigFile?