diff --git a/Shorewall-perl/Shorewall/Providers.pm b/Shorewall-perl/Shorewall/Providers.pm index 714e6795a..a473fb4c3 100644 --- a/Shorewall-perl/Shorewall/Providers.pm +++ b/Shorewall-perl/Shorewall/Providers.pm @@ -457,10 +457,10 @@ sub add_a_provider( $$$$$$$$ ) { emit 'else'; if ( $optional ) { - emit ( " error_message \"WARNING: Interface $interface is not configured -- Provider $table ($number) not Added\"", + emit ( " error_message \"WARNING: Interface $interface is not usable -- Provider $table ($number) not Added\"", " ${base}_IS_UP=" ); } else { - emit( " fatal_error \"Interface $interface is not configured -- Provider $table ($number) Cannot be Added\"" ); + emit( " fatal_error \"Interface $interface is not usable -- Provider $table ($number) Cannot be Added\"" ); } emit "fi\n"; @@ -632,9 +632,15 @@ sub setup_providers() { emit ( " qt ip -$family route del default table " . MAIN_TABLE ) if $config{USE_DEFAULT_RT}; emit ( " progress_message \"Default route '\$(echo \$DEFAULT_ROUTE | sed 's/\$\\s*//')' Added\"", 'else', - ' error_message "WARNING: No Default route added (all \'balance\' providers are down)"', - ' restore_default_route', - 'fi', + ' error_message "WARNING: No Default route added (all \'balance\' providers are down)"' ); + + if ( $config{RESTORE_DEFAULT_ROUTE} ) { + emit ' restore_default_route && error_message "NOTICE: Default route restored"' + } else { + emit qq( qt ip -$family route del default table $table && error_message "WARNING: Default route deleted from table $table"); + } + + emit( 'fi', '' ); } else { emit ( '#', diff --git a/Shorewall-perl/prog.header b/Shorewall-perl/prog.header index b03f9ff02..2815a00c5 100644 --- a/Shorewall-perl/prog.header +++ b/Shorewall-perl/prog.header @@ -936,6 +936,8 @@ restore_default_route() { local default_route default_route= local route + local result + result=1 while read route ; do case $route in @@ -951,6 +953,7 @@ restore_default_route() { ;; *) qt ip -4 route replace $default_route && \ + result=0 && \ progress_message "Default Route (${default_route# }) restored" ;; esac @@ -968,6 +971,8 @@ restore_default_route() { rm -f ${VARDIR}/default_route fi + + return $result } # diff --git a/Shorewall-perl/prog.header6 b/Shorewall-perl/prog.header6 index 2b7db4db6..d9e02c760 100644 --- a/Shorewall-perl/prog.header6 +++ b/Shorewall-perl/prog.header6 @@ -856,6 +856,8 @@ restore_default_route() { local default_route default_route= local route + local result + result=1 while read route ; do case $route in @@ -871,6 +873,7 @@ restore_default_route() { ;; *) qt ip -6 route replace $default_route && \ + result=0 && \ progress_message "Default Route (${default_route# }) restored" ;; esac @@ -888,6 +891,8 @@ restore_default_route() { rm -f ${VARDIR}/default_route fi + + return $result } #