line |
true |
false |
branch |
40
|
0 |
0 |
unless ref $self |
48
|
0 |
0 |
if ($INT or $TERM) |
49
|
0 |
0 |
$TERM ? : |
56
|
0 |
0 |
if @{$self->{'pending'};} == 0 and $self->{'running'}->count == 0 |
61
|
0 |
0 |
unless ($self->{'quiet'}) |
65
|
0 |
0 |
@fail ? : |
82
|
0 |
0 |
unless &GetOptions('c|concurrency=i', \($self->{'concurrency'} = 5), 'h|help', sub {
pod2usage('verbose', 99, 'sections', 'SYNOPSIS|OPTIONS|EXAMPLES');
}
, 's|script=s', \$self->{'script'}, 'v|version', sub {
printf "%s %s\n", 'App::RemoteCommand', $VERSION;
exit;
}
, 'a|ask-sudo-password', \my $ask_sudo_password, 'H|host-file=s', \my $host_file, 'sudo-password=s', \$self->{'sudo_password'}, 'append-hostname!', \(my $append_hostname = 1), 'append-time!', \my $append_time, 'sudo=s', \$self->{'sudo_user'}, 'q|quiet', \$self->{'quiet'}) |
85
|
0 |
0 |
$host_file ? : |
86
|
0 |
0 |
if ($self->{'script'}) { } |
92
|
0 |
0 |
unless $self->{'command'} |
|
0 |
0 |
unless (@{[] unless $self->{'command'};} or $self->{'script'}) |
96
|
0 |
0 |
if ($self->{'script'}) |
98
|
0 |
0 |
unless File::Copy::copy($self->{'script'}, $tempfh) |
110
|
0 |
0 |
if ($ask_sudo_password) |
114
|
0 |
0 |
$host_file ? : |
138
|
0 |
0 |
if ($self->{'select'}->count == 0) { } |
149
|
0 |
0 |
if ($pid > 0 and my $remove = $self->{'select'}->remove('pid', $pid)) |
154
|
0 |
0 |
$pid > 0 ? : |
156
|
0 |
0 |
unless ($is_running) |
172
|
0 |
0 |
if ($len) { } |
|
0 |
0 |
elsif (not defined $len) { } |
173
|
0 |
0 |
if (my(@line) = $buffer->add($buf)->get) |
175
|
0 |
0 |
if ($ready->{'sudo'} and @line == 1 and $line[0] eq $SUDO_FAIL) |
182
|
0 |
0 |
if ($buffer->raw eq $SUDO_PROMPT) |
186
|
0 |
0 |
if (my $sudo_password = $self->{'sudo_password'}) { } |
196
|
0 |
0 |
if ($errno != 5) |
210
|
0 |
0 |
if ($fh) |
217
|
0 |
0 |
if (defined $len and $len > 0) { } |
233
|
0 |
0 |
if $self->{'sudo_user'} |
237
|
0 |
0 |
if (my $script = $self->{'script'}) { } |
255
|
0 |
0 |
@{$self->{'command'};} == 1 && $self->{'command'}[0] =~ /$escape/ ? : |
268
|
0 |
0 |
if $ssh_at_exit |
275
|
0 |
0 |
if ($opt{'append_time'} and $opt{'append_hostname'}) { } |
|
0 |
0 |
elsif ($opt{'append_time'}) { } |
|
0 |
0 |
elsif ($opt{'append_hostname'}) { } |
293
|
0 |
0 |
unless open my $fh, '<', $host_file |
297
|
0 |
0 |
if $line =~ /^[^#\s]/ |