From 222fb2c10f291e2d2a51cfa6a0d6a516a6ac08fc Mon Sep 17 00:00:00 2001 From: teastep Date: Fri, 13 Jan 2006 17:08:23 +0000 Subject: [PATCH] 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 --- Shorewall/changelog.txt | 3 +++ Shorewall/firewall | 28 ++++++++++++---------------- Shorewall/releasenotes.txt | 8 +++----- Shorewall/shorewall | 2 +- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/Shorewall/changelog.txt b/Shorewall/changelog.txt index ba587acd7..16e811654 100755 --- a/Shorewall/changelog.txt +++ b/Shorewall/changelog.txt @@ -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/) diff --git a/Shorewall/firewall b/Shorewall/firewall index a91217caf..fd52475ae 100755 --- a/Shorewall/firewall +++ b/Shorewall/firewall @@ -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,9 +1559,11 @@ __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 ensure_and_save_command " ip route replace default scope global $DEFAULT_ROUTE" @@ -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 - + [ -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" [ -f $outfile -a ! -x $outfile ] && startup_error "$outfile exists and is not a restore file" RESTOREBASE=$(mktempfile /var/lib/shorewall) diff --git a/Shorewall/releasenotes.txt b/Shorewall/releasenotes.txt index af484db91..e014b5b1a 100755 --- a/Shorewall/releasenotes.txt +++ b/Shorewall/releasenotes.txt @@ -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: Is an optional directory to be searched for configuration files prior to those listed in CONFIG_DIR in /etc/shorewall/shorewall.conf. -