forked from extern/shorewall_code
Change output from 'compile' to the entered name in all cases (do not append /var/lib/shorewall)
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3276 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
b5dbeb1ead
commit
222fb2c10f
@ -9,3 +9,6 @@ Changes in 3.1.0
|
||||
4) Add back dynamic zones.
|
||||
|
||||
5) Allow remote compiles.
|
||||
|
||||
6) Change output of 'generate' to always be the file name entered (do not
|
||||
prepend /var/lib/shorewall/)
|
||||
|
@ -1308,7 +1308,7 @@ verify_mark() # $1 = value to test
|
||||
#
|
||||
setup_providers()
|
||||
{
|
||||
local table number mark duplicate interface gateway options provider address copy route loose addresses rulenum pref echobin=$(mywhich echo)
|
||||
local table number mark duplicate interface gateway options provider address copy route loose addresses rulenum pref echobin=$(mywhich echo) balance
|
||||
|
||||
copy_table() {
|
||||
if [ $COMMAND = generate ]; then
|
||||
@ -1459,6 +1459,7 @@ __EOF__
|
||||
ROUTEMARK_INTERFACES="$ROUTEMARK_INTERFACES $interface"
|
||||
;;
|
||||
balance=*)
|
||||
balance=yes
|
||||
if [ $COMMAND = generate ]; then
|
||||
save_command " DEFAULT_ROUTE=\"\$DEFAULT_ROUTE nexthop via \$gateway dev $interface weight ${option#*=}\""
|
||||
else
|
||||
@ -1466,6 +1467,7 @@ __EOF__
|
||||
fi
|
||||
;;
|
||||
balance)
|
||||
balance=yes
|
||||
if [ $COMMAND = generate ]; then
|
||||
save_command " DEFAULT_ROUTE=\"\$DEFAULT_ROUTE nexthop via \$gateway dev $interface weight 1\""
|
||||
else
|
||||
@ -1527,6 +1529,7 @@ __EOF__
|
||||
|
||||
if [ -s $TMP_DIR/providers ]; then
|
||||
DEFAULT_ROUTE=
|
||||
balance=
|
||||
|
||||
if [ $COMMAND != check ]; then
|
||||
progress_message2 "Processing $1..."
|
||||
@ -1556,8 +1559,10 @@ __EOF__
|
||||
if [ -n "$PROVIDERS" ]; then
|
||||
case $COMMAND in
|
||||
generate)
|
||||
save_command " [ -n \"\$DEFAULT_ROUTE\" ] && ip route replace default scope global \$DEFAULT_ROUTE"
|
||||
if [ -n "$balance" ]; then
|
||||
save_command " ip route replace default scope global \$DEFAULT_ROUTE"
|
||||
save_command " progress_message Default route \$DEFAULT_ROUTE Added"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if [ -n "$DEFAULT_ROUTE" ]; then
|
||||
@ -8972,19 +8977,10 @@ compile_firewall() # $1 = File Name
|
||||
|
||||
[ -d /var/lib/shorewall ] || { mkdir -p /var/lib/shorewall ; chmod 700 /var/lib/shorewall; }
|
||||
|
||||
case $outfile in
|
||||
*/*)
|
||||
[ -d $dir ] || startup_error "Directory $dir does not exist"
|
||||
[ -h $dir ] && startup_error "$dir is a Symbolic Link"
|
||||
[ -d $outfile ] && startup_error "$outfile is a Directory"
|
||||
[ -h $outfile ] && startup_error "$outfile is a Symbolic Link"
|
||||
|
||||
;;
|
||||
*)
|
||||
outfile=/var/lib/shorewall/$1
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -f $outfile -a ! -x $outfile ] && startup_error "$outfile exists and is not a restore file"
|
||||
|
||||
RESTOREBASE=$(mktempfile /var/lib/shorewall)
|
||||
|
@ -1,4 +1,4 @@
|
||||
Shorewall 3.1.1
|
||||
Shorewall 3.1.2
|
||||
|
||||
Note to users upgrading from Shorewall 2.x or 3.0
|
||||
|
||||
@ -52,9 +52,7 @@ New Features:
|
||||
<config directory> Is an optional directory to be searched for
|
||||
configuration files prior to those listed
|
||||
in CONFIG_DIR in /etc/shorewall/shorewall.conf.
|
||||
<script file> Is the name of the output file. If a simple
|
||||
filename is given, the file will be created in
|
||||
/var/lib/shorewall.
|
||||
<script file> Is the name of the output file.
|
||||
|
||||
The 'generate' command processes the configuration and writes a script file
|
||||
which may then be executed (either directly or using the 'shorewall restore'
|
||||
@ -100,7 +98,7 @@ New Features:
|
||||
The 'reload' command creates a script using 'generate' and if there are
|
||||
no errors, it then restores that script. It is equivalent to:
|
||||
|
||||
if shorewall generate .reload; then restore .reload; fi
|
||||
if shorewall generate /var/lib/shorewall/.reload; then restore .reload; fi
|
||||
|
||||
The advantage of using reload over restart is that reload results in new
|
||||
connections being dropped for a much shorter time. Here are the results of
|
||||
|
@ -928,7 +928,7 @@ case "$1" in
|
||||
|
||||
export NOROUTES
|
||||
|
||||
if $SHOREWALL_SHELL $FIREWALL $debugging $nolock compile .reload; then
|
||||
if $SHOREWALL_SHELL $FIREWALL $debugging $nolock compile /var/lib/shorewall/.reload; then
|
||||
$0 $(make_quiet) restore .reload
|
||||
fi
|
||||
;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user