mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 01:37:59 +02:00
Relocate code that sets provider variables
This commit is contained in:
parent
8eb6ab7cc9
commit
b6410902a0
@ -262,6 +262,32 @@ sub generate_script_2() {
|
|||||||
emit ( 'esac' ) ,
|
emit ( 'esac' ) ,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unless ( $providers ) {
|
||||||
|
my $interfaces = find_interfaces_by_option 'optional';
|
||||||
|
|
||||||
|
if ( $interfaces ) {
|
||||||
|
emit '';
|
||||||
|
|
||||||
|
my $first = 1;
|
||||||
|
|
||||||
|
for my $interface ( @$interfaces ) {
|
||||||
|
my $base = uc chain_base( $interface );
|
||||||
|
|
||||||
|
if ( $first ) {
|
||||||
|
$first = 0;
|
||||||
|
} else {
|
||||||
|
emit '';
|
||||||
|
}
|
||||||
|
|
||||||
|
emit ( "if interface_is_usable $interface; then" ,
|
||||||
|
" ${base}_IS_UP=Yes" ,
|
||||||
|
'else' ,
|
||||||
|
" ${base}_IS_UP=" ,
|
||||||
|
'fi' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pop_indent;
|
pop_indent;
|
||||||
|
|
||||||
emit "\n}\n"; # End of initialize()
|
emit "\n}\n"; # End of initialize()
|
||||||
|
@ -33,7 +33,7 @@ use Shorewall::Chains qw(:DEFAULT :internal);
|
|||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
our @EXPORT = qw( setup_providers @routemarked_interfaces handle_stickiness );
|
our @EXPORT = qw( setup_providers @routemarked_interfaces handle_stickiness $providers );
|
||||||
our @EXPORT_OK = qw( initialize lookup_provider );
|
our @EXPORT_OK = qw( initialize lookup_provider );
|
||||||
our $VERSION = '4.3_7';
|
our $VERSION = '4.3_7';
|
||||||
|
|
||||||
@ -56,6 +56,8 @@ our %providers;
|
|||||||
|
|
||||||
our @providers;
|
our @providers;
|
||||||
|
|
||||||
|
our $providers;
|
||||||
|
|
||||||
our $family;
|
our $family;
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -746,7 +748,7 @@ sub test_optional_providers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub setup_providers() {
|
sub setup_providers() {
|
||||||
my $providers = 0;
|
$providers = 0;
|
||||||
|
|
||||||
my $fn = open_file 'providers';
|
my $fn = open_file 'providers';
|
||||||
|
|
||||||
@ -794,30 +796,6 @@ sub setup_providers() {
|
|||||||
|
|
||||||
emit "fi\n";
|
emit "fi\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
my $interfaces = find_interfaces_by_option 'optional';
|
|
||||||
|
|
||||||
if ( $interfaces ) {
|
|
||||||
emit '';
|
|
||||||
|
|
||||||
my $first = 1;
|
|
||||||
|
|
||||||
for my $interface ( @$interfaces ) {
|
|
||||||
my $base = uc chain_base( $interface );
|
|
||||||
|
|
||||||
if ( $first ) {
|
|
||||||
$first = 0;
|
|
||||||
} else {
|
|
||||||
emit '';
|
|
||||||
}
|
|
||||||
|
|
||||||
emit ( "if interface_is_usable $interface; then" ,
|
|
||||||
" ${base}_IS_UP=Yes" ,
|
|
||||||
'else' ,
|
|
||||||
" ${base}_IS_UP=" ,
|
|
||||||
'fi' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user