mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-18 12:20:42 +01:00
More Shorewall-init fixes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
f266d9a4dc
commit
402e155148
@ -106,12 +106,6 @@ if [ -f /etc/debian_version ]; then
|
|||||||
else
|
else
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$PHASE" in
|
|
||||||
post-*)
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
elif [ -f /etc/SuSE-release ]; then
|
elif [ -f /etc/SuSE-release ]; then
|
||||||
|
@ -1539,7 +1539,12 @@ sub compile_updown() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit( "*)",
|
if ( my @plain_interfaces = all_plain_interfaces ) {
|
||||||
|
my $interfaces = join ( '|', map get_physical( $_ ), @plain_interfaces );
|
||||||
|
|
||||||
|
$interfaces =~ s/\+/*/g;
|
||||||
|
|
||||||
|
emit( "$interfaces)",
|
||||||
' case $state in',
|
' case $state in',
|
||||||
' started)',
|
' started)',
|
||||||
' COMMAND=restart',
|
' COMMAND=restart',
|
||||||
@ -1552,6 +1557,7 @@ sub compile_updown() {
|
|||||||
' ;;',
|
' ;;',
|
||||||
' esac',
|
' esac',
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
pop_indent;
|
pop_indent;
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ our @EXPORT = qw( NOTHING
|
|||||||
validate_interfaces_file
|
validate_interfaces_file
|
||||||
all_interfaces
|
all_interfaces
|
||||||
all_real_interfaces
|
all_real_interfaces
|
||||||
|
all_plain_interfaces
|
||||||
all_bridges
|
all_bridges
|
||||||
interface_number
|
interface_number
|
||||||
find_interface
|
find_interface
|
||||||
@ -72,6 +73,7 @@ our @EXPORT = qw( NOTHING
|
|||||||
port_to_bridge
|
port_to_bridge
|
||||||
source_port_to_bridge
|
source_port_to_bridge
|
||||||
interface_is_optional
|
interface_is_optional
|
||||||
|
interface_is_required
|
||||||
find_interfaces_by_option
|
find_interfaces_by_option
|
||||||
find_interfaces_by_option1
|
find_interfaces_by_option1
|
||||||
get_interface_option
|
get_interface_option
|
||||||
@ -1417,6 +1419,21 @@ sub interface_is_optional($) {
|
|||||||
$optionsref && $optionsref->{optional};
|
$optionsref && $optionsref->{optional};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Return the 'required' setting of the passed interface
|
||||||
|
#
|
||||||
|
sub interface_is_required($) {
|
||||||
|
my $optionsref = $interfaces{$_[0]}{options};
|
||||||
|
$optionsref && $optionsref->{required};
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Return a list of real interfaces that are neither
|
||||||
|
#
|
||||||
|
sub all_plain_interfaces() {
|
||||||
|
grep ! ( $_ eq '%vserver%' || interface_is_optional($_) || interface_is_required($_) ), @interfaces;
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns reference to array of interfaces with the passed option
|
# Returns reference to array of interfaces with the passed option
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user