From 2a52d3342d3779979c1ccb48c8f827fd0a2160c1 Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 28 Jul 2005 14:37:56 +0000 Subject: [PATCH] Fix Makefile; rename status to dump and create a real status command git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@2427 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/Makefile | 2 +- Shorewall/changelog.txt | 4 ++++ Shorewall/help | 22 ++++++++++++++++------ Shorewall/releasenotes.txt | 10 ++++++++++ Shorewall/shorewall | 17 ++++++++++++++++- 5 files changed, 47 insertions(+), 8 deletions(-) diff --git a/Shorewall/Makefile b/Shorewall/Makefile index f5d7afed3..fdf505dea 100644 --- a/Shorewall/Makefile +++ b/Shorewall/Makefile @@ -3,7 +3,7 @@ VARDIR=/var/lib/shorewall CONFDIR=/etc/shorewall all: $(VARDIR)/restarted -$(VARDIR)/restarted: $(CONFDIR)/* +$(VARDIR)/restore-base: $(CONFDIR)/* @/sbin/shorewall -q save >/dev/null; \ if \ /sbin/shorewall -q restart >/dev/null 2>&1; \ diff --git a/Shorewall/changelog.txt b/Shorewall/changelog.txt index 7d507da1f..3c3d6b25d 100755 --- a/Shorewall/changelog.txt +++ b/Shorewall/changelog.txt @@ -4,6 +4,10 @@ Changes in 2.5.1 2) Remove dependence on 'which' +3) Rename "status" to "dump" and add real status command. + +4) Fix Makefile (compare to restore-base rather than restarted). + Changes in 2.5.1ex/2.5.0 1) Clean up handling of zones diff --git a/Shorewall/help b/Shorewall/help index 437a08ff7..14d03ea36 100755 --- a/Shorewall/help +++ b/Shorewall/help @@ -135,6 +135,18 @@ drop) See also \"help address\"" ;; +dump) + echo "dump: dump + + shorewall [-x] dump + + Produce a verbose report about the firewall for problem analysis. + + (iptables -L -n -) + + When -x is given, that option is also passed to iptables to display actual packet and byte counts." + ;; + forget) echo "forget: forget [ ] Deletes /var/lib/shorewall/. If no is given then @@ -288,13 +300,11 @@ stop) status) echo "status: status - shorewall [-x] status + shorewall status - Produce a verbose report about the firewall. - - (iptables -L -n -) - - When -x is given, that option is also passed to iptables to display actual packet and byte counts." + Displays the Shorewall status (started/not-started). If Shorewall is started, + the time at which Shorewall was last started/restarted/refreshed or reset is + displayed. ;; trace) diff --git a/Shorewall/releasenotes.txt b/Shorewall/releasenotes.txt index a274ae96d..517a16c1f 100755 --- a/Shorewall/releasenotes.txt +++ b/Shorewall/releasenotes.txt @@ -7,6 +7,12 @@ Problems Corrected in 2.5.1: 2) "shorewall add" no longer fails when the 'ipsec' option has appeared in /etc/shorewall/hosts. +3) The Makefile has been changed to compare the modification times of + the files in /etc/shorewall with + /var/lib/shorewall/restore-base. That file is modified each time + that Shorewall is [re]started whereas /var/lib/shorewall/restarted + is also modified by "shorewall reset" and "shorewall refresh". + Problems Corrected in 2.5.0: 1) The behavior of CONTINUE policies has been improved. Shorewall no @@ -137,6 +143,10 @@ Migration Considerations: from that directory to /var/lib/shorewall/ before [re]starting Shorewall after the upgrade to this version. +7) The "shorewall status" command now just gives the status of + Shorewall (started or not-started). The previous status command has + been renamed "dump". + New Features in Shorewall 2.5.0 1) Error and warning messages are made easier to spot by using diff --git a/Shorewall/shorewall b/Shorewall/shorewall index 0c49edf4e..d4b1e8eec 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -33,6 +33,8 @@ # # shorewall add [:] zone Adds a host or subnet to a zone # shorewall delete [:] zone Deletes a host or subnet from a zone +# shorewall dump Dumps all Shorewall-related information +# for problem analysis # shorewall start Starts the firewall # shorewall restart Restarts the firewall # shorewall stop Stops the firewall @@ -495,6 +497,7 @@ usage() # $1 = exit status echo " clear" echo " delete [:{[:]|}[,...]] ... " echo " drop
..." + echo " dump" echo " forget [ ]" echo " help [ | host | address ]" echo " hits" @@ -905,10 +908,22 @@ case "$1" in esac ;; status) + [ $# -eq 1 ] || usage 1 + echo "Shorewall-$version Status at $HOSTNAME - $(date)" + echo + if qt $IPTABLES -L shorewall -n -v; then + echo "Shorewall is started" + echo + show_reset + else + echo "Shorewall is not started" + fi + ;; + dump) [ -n "$debugging" ] && set -x [ $# -eq 1 ] || usage 1 clear_term - echo "Shorewall-$version Status at $HOSTNAME - $(date)" + echo "Shorewall-$version Dump at $HOSTNAME - $(date)" echo show_reset host=$(echo $HOSTNAME | sed 's/\..*$//')