Some more cosmetic changes

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5693 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-03-26 01:28:52 +00:00
parent 0f33920874
commit c2140b4923

View File

@ -482,15 +482,16 @@ sub generate_script_2 () {
emit ''; emit '';
for my $interface ( @{find_interfaces_by_option 'norfc1918'} ) { for my $interface ( @{find_interfaces_by_option 'norfc1918'} ) {
emit "addr=\$(ip -f inet addr show $interface 2> /dev/null | grep 'inet\ ' | head -n1)"; emit join( "\n",
emit 'if [ -n "$addr" ]; then'; "addr=\$(ip -f inet addr show $interface 2> /dev/null | grep 'inet\ ' | head -n1)",
emit q( addr=$(echo $addr | sed 's/inet //;s/\/.*//;s/ peer.*//')); 'if [ -n "$addr" ]; then',
emit ' for network in 10.0.0.0/8 176.16.0.0/12 192.168.0.0/16; do'; ' addr=$(echo $addr | sed \'s/inet //;s/\/.*//;s/ peer.*//\')',
emit ' if in_network $addr $network; then'; ' for network in 10.0.0.0/8 176.16.0.0/12 192.168.0.0/16; do',
emit " startup_error \"The 'norfc1918' option has been specified on an interface with an RFC 1918 address. Interface:$interface\""; ' if in_network $addr $network; then',
emit ' fi'; " startup_error \"The 'norfc1918' option has been specified on an interface with an RFC 1918 address. Interface:$interface\"",
emit ' done'; ' fi',
emit "fi\n"; ' done',
"fi\n" );
} }
emit "run_init_exit\n"; emit "run_init_exit\n";