line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Wireguard::WGmeta::Cli::Commands::Disable; |
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use experimental 'signatures'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
83
|
use Wireguard::WGmeta::Wrapper::Config; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
7
|
1
|
|
|
1
|
|
6
|
use parent 'Wireguard::WGmeta::Cli::Commands::Command'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
1
|
3
|
sub entry_point($self) { |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
11
|
1
|
50
|
|
|
|
14
|
if ($self->_retrieve_or_die($self->{input_args}, 0) eq 'help') { |
12
|
0
|
|
|
|
|
0
|
$self->cmd_help(); |
13
|
|
|
|
|
|
|
} |
14
|
1
|
|
|
|
|
7
|
$self->check_privileges(); |
15
|
1
|
|
|
|
|
6
|
$self->_run_command(); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
2
|
sub _run_command($self) { |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
20
|
1
|
|
|
|
|
5
|
my $interface = $self->_retrieve_or_die($self->{input_args}, 0); |
21
|
1
|
|
|
|
|
9
|
my $identifier = $self->_retrieve_or_die($self->{input_args}, 1); |
22
|
1
|
|
|
|
|
10
|
$identifier = $self->wg_meta->try_translate_alias($interface, $identifier); |
23
|
1
|
|
|
|
|
4
|
$self->wg_meta->disable($interface, $identifier); |
24
|
|
|
|
|
|
|
|
25
|
1
|
50
|
|
|
|
6
|
if (defined $ENV{IS_TESTING}) { |
26
|
|
|
|
|
|
|
# omit header |
27
|
1
|
|
|
|
|
4
|
$self->wg_meta->commit(1, 1); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
else { |
30
|
0
|
|
|
|
|
|
$self->wg_meta->commit(1, 0); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
0
|
1
|
|
sub cmd_help($self) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
print "Usage: wg-meta disable {alias | public-key} \n"; |
37
|
0
|
|
|
|
|
|
exit; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |