More Shorewall-init fixes

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-06-01 14:01:58 -07:00
parent f266d9a4dc
commit 402e155148
3 changed files with 36 additions and 19 deletions

View File

@ -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

View File

@ -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;

View File

@ -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
# #