… | |
… | |
27 | eval $cmd; |
27 | eval $cmd; |
28 | } |
28 | } |
29 | print $@ if $@; |
29 | print $@ if $@; |
30 | } |
30 | } |
31 | |
31 | |
32 | print "> "; |
32 | print "> "; |
33 | select $old_fh; |
33 | select $old_fh; |
34 | } else { |
34 | } else { |
35 | $_[0]->w->cancel; |
35 | $_[0]->w->cancel; |
36 | } |
36 | } |
37 | }); |
37 | }); |
38 | } |
38 | } |
39 | |
39 | |
40 | # now a shell listening on a tcp-port - let the firewall decide access rights |
40 | # now a shell listening on a tcp-port - let the firewall decide access rights |
|
|
41 | if ($cf::CFG{perl_shell}) { |
41 | if (my $listen = new IO::Socket::INET LocalAddr => "127.0.0.1:13322", Listen => 1, ReuseAddr => 1) { |
42 | if (my $listen = new IO::Socket::INET LocalAddr => $cf::CFG{perl_shell}, Listen => 1, ReuseAddr => 1) { |
42 | Event->io (fd => $listen, poll => 'r', cb => sub { tcp_serve $listen->accept }); |
43 | Event->io (fd => $listen, poll => 'r', cb => sub { tcp_serve $listen->accept }); |
|
|
44 | } |
43 | } |
45 | } |