… | |
… | |
16 | } elsif (/^i/) { |
16 | } elsif (/^i/) { |
17 | my @data; |
17 | my @data; |
18 | for (values %conn::conn) { |
18 | for (values %conn::conn) { |
19 | for (values %$_) { |
19 | for (values %$_) { |
20 | next unless $_; |
20 | next unless $_; |
21 | push @data, "$_: $_->{remote_addr} $_->{uri}\n"; |
21 | push @data, "$_->{country}/$_->{remote_addr} $_->{method} $_->{uri}\n"; |
22 | } |
22 | } |
23 | } |
23 | } |
24 | print $fh sort @data; |
24 | print $fh sort @data; |
25 | print $fh scalar@data, " connections\n";#d# |
25 | print $fh scalar@data, " connections\n";#d# |
|
|
26 | } elsif (/^ref/) { |
|
|
27 | read_blocklist; |
26 | } elsif (/^r/) { |
28 | } elsif (/^r/) { |
27 | $::RESTART = 1; |
29 | $::RESTART = 1; |
28 | unloop; |
30 | unloop; |
29 | print $fh "bye bye.\n"; |
31 | print $fh "bye bye.\n"; |
30 | last; |
32 | last; |
31 | } else { |
33 | } else { |
32 | print $fh "try quit, info, restart\n"; |
34 | print $fh "try quit, info, restart, refresh\n"; |
33 | } |
35 | } |
34 | } |
36 | } |
35 | } |
37 | } |
36 | |
38 | |
37 | # bind to tcp port |
39 | # bind to tcp port |
… | |
… | |
44 | or die "unable to bind cmdshell port: $!"; |
46 | or die "unable to bind cmdshell port: $!"; |
45 | |
47 | |
46 | push @listen_sockets, $port; |
48 | push @listen_sockets, $port; |
47 | |
49 | |
48 | async { |
50 | async { |
|
|
51 | while () { |
49 | async \&shell, $port->accept |
52 | async \&shell, scalar $port->accept; |
50 | while 1; |
53 | } |
51 | }; |
54 | }; |
52 | } |
55 | } |
53 | |
56 | |
54 | # bind to stdin (debug) |
57 | # bind to stdin (debug) |
55 | if (1) { |
58 | if (1) { |