mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-25 00:53:49 +01:00
Merge branch 'clean-test-ipset' into 'master'
Destroy the temporary IP set in the cleanup function See merge request shorewall/code!13
This commit is contained in:
commit
3c77d83260
@ -1507,7 +1507,7 @@ sub qt1( $ ) {
|
||||
}
|
||||
|
||||
#
|
||||
# Delete the test chains
|
||||
# Delete the test chains and IP sets
|
||||
#
|
||||
sub cleanup_iptables() {
|
||||
qt1( "$iptables $iptablesw -F $sillyname" );
|
||||
@ -1530,6 +1530,12 @@ sub cleanup_iptables() {
|
||||
qt1( "$iptables $iptablesw -t raw -X $sillyname" );
|
||||
}
|
||||
|
||||
my $ipset = $config{IPSET} || 'ipset';
|
||||
$ipset = which( $ipset ) unless $ipset =~ '/';
|
||||
if ( $ipset && -x $ipset ) {
|
||||
qt( "$ipset -X $sillyname" );
|
||||
}
|
||||
|
||||
$sillyname = $sillyname1 = '';
|
||||
}
|
||||
|
||||
@ -1574,7 +1580,7 @@ sub cleanup() {
|
||||
unlink ( $perlscriptname ), $perlscriptname = undef if $perlscriptname;
|
||||
unlink ( @tempfiles ), @tempfiles = () if @tempfiles;
|
||||
#
|
||||
# Delete temporary chains
|
||||
# Delete temporary chains and IP sets
|
||||
#
|
||||
cleanup_iptables if $sillyname;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user