Skip to content

Commit

Permalink
ipsecbase.pm: check firewall status before stop firewall
Browse files Browse the repository at this point in the history
  • Loading branch information
coolgw committed Jan 13, 2025
1 parent f621758 commit 6602e0d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
8 changes: 0 additions & 8 deletions lib/ipsecbase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,4 @@ sub pre_run_hook {
$self->SUPER::pre_run_hook;
}

sub ensure_service_disabled {
my ($service) = @_;
unless (systemctl "is-active " . $service, ignore_failure => 1) { # 0 if active, unless to revert
systemctl "disable --now " . $service;
record_info $service, "disabled";
}
}

1;
16 changes: 16 additions & 0 deletions lib/utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ our @EXPORT = qw(
is_efi_boot
install_patterns
common_service_action
ensure_service_disabled
script_output_retry
validate_script_output_retry
get_secureboot_status
Expand Down Expand Up @@ -2546,6 +2547,21 @@ sub common_service_action {
}
}

=head2 ensure_service_disabled
ensure_service_disabled();
Make sure service is disabled before test.
=cut

sub ensure_service_disabled {
my ($service) = @_;
unless (systemctl "is-active " . $service, ignore_failure => 1) { # 0 if active, unless to revert
systemctl "disable --now " . $service;
record_info $service, "disabled";
}
}

sub get_secureboot_status {
my $sbvar = '8be4df61-93ca-11d2-aa0d-00e098032b8c-SecureBoot';
my $ret;
Expand Down

0 comments on commit 6602e0d

Please sign in to comment.