… | |
… | |
51 | printf $fh "(%.1f bytes/s)\n", $::written / ($::NOW - $last_ts); |
51 | printf $fh "(%.1f bytes/s)\n", $::written / ($::NOW - $last_ts); |
52 | ($last_ts, $::written) = ($::NOW, 0); |
52 | ($last_ts, $::written) = ($::NOW, 0); |
53 | } elsif ($cmd eq "refresh") { |
53 | } elsif ($cmd eq "refresh") { |
54 | do "config.pl"; |
54 | do "config.pl"; |
55 | print $fh "config.pl: $@\n" if $@; |
55 | print $fh "config.pl: $@\n" if $@; |
56 | read_blocklist; |
56 | read_blockuri; |
|
|
57 | read_blockref; |
57 | } elsif ($cmd eq "restart") { |
58 | } elsif ($cmd eq "restart") { |
58 | $::RESTART = 1; |
59 | $::RESTART = 1; |
59 | unloop; |
60 | unloop; |
60 | print $fh "restarting, cu!\n"; |
61 | print $fh "restarting, cu!\n"; |
61 | last; |
62 | last; |
… | |
… | |
69 | } |
70 | } |
70 | |
71 | |
71 | # bind to tcp port |
72 | # bind to tcp port |
72 | if ($CMDSHELL_PORT) { |
73 | if ($CMDSHELL_PORT) { |
73 | my $port = new Coro::Socket |
74 | my $port = new Coro::Socket |
74 | LocalAddr => "127.0.0.1", |
75 | #LocalAddr => "127.0.0.1", |
75 | LocalPort => $CMDSHELL_PORT, |
76 | LocalPort => $CMDSHELL_PORT, |
76 | ReuseAddr => 1, |
77 | ReuseAddr => 1, |
77 | Listen => 1, |
78 | Listen => 1, |
78 | or die "unable to bind cmdshell port: $!"; |
79 | or die "unable to bind cmdshell port: $!"; |
79 | |
80 | |