2008-12-07 19:17:26 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2009-02-22 17:54:19 +01:00
|
|
|
# Shorewall Packet Filtering Firewall Control Program - V4.4
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
|
|
|
#
|
2011-05-23 18:51:51 +02:00
|
|
|
# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011 -
|
|
|
|
# Tom Eastep (teastep@shorewall.net)
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Shorewall documentation is available at http://www.shorewall.net
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of Version 2 of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
2011-12-03 19:59:01 +01:00
|
|
|
# For a list of supported commands, type 'shorewall help' or 'shorewall6 help'
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2011-05-23 23:36:21 +02:00
|
|
|
################################################################################################
|
2010-02-23 01:43:38 +01:00
|
|
|
g_debugging=
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
if [ $# -gt 0 ] && [ "x$1" = "xdebug" -o "x$1" = "xtrace" ]; then
|
2010-02-23 01:43:38 +01:00
|
|
|
g_debugging=$1
|
2008-12-07 19:17:26 +01:00
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2011-12-19 15:29:05 +01:00
|
|
|
g_nolock=
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
if [ $# -gt 0 ] && [ "$1" = "nolock" ]; then
|
2011-12-19 15:29:05 +01:00
|
|
|
g_nolock=nolock
|
2008-12-07 19:17:26 +01:00
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2010-03-03 18:50:07 +01:00
|
|
|
g_noroutes=
|
|
|
|
g_purge=
|
2010-02-22 17:05:23 +01:00
|
|
|
g_ipt_options="-nv"
|
|
|
|
g_fast=
|
|
|
|
g_verbose_offset=0
|
|
|
|
g_use_verbosity=
|
|
|
|
g_debug=
|
|
|
|
g_export=
|
2011-05-16 22:08:32 +02:00
|
|
|
g_refreshchains=:none:
|
2011-05-24 19:21:49 +02:00
|
|
|
g_confess=
|
2011-06-19 16:14:27 +02:00
|
|
|
g_update=
|
2011-11-08 21:59:40 +01:00
|
|
|
g_convert=
|
2011-06-18 22:03:55 +02:00
|
|
|
g_annotate=
|
2011-12-20 00:52:42 +01:00
|
|
|
g_recovering=
|
|
|
|
g_timestamp=
|
|
|
|
g_libexec=/usr/share
|
|
|
|
g_perllib=/usr/share/shorewall
|
2011-12-20 17:19:57 +01:00
|
|
|
g_shorewalldir=
|
|
|
|
|
2010-10-29 00:17:37 +02:00
|
|
|
VERBOSE=
|
|
|
|
VERBOSITY=
|
|
|
|
|
2011-12-03 22:13:25 +01:00
|
|
|
g_program=$(basename $0)
|
|
|
|
|
|
|
|
if [ $g_program = shorewall6 ]; then
|
|
|
|
SHAREDIR=/usr/share/shorewall6
|
|
|
|
CONFDIR=/etc/shorewall6
|
|
|
|
g_product="Shorewall6"
|
|
|
|
g_family=6
|
|
|
|
g_tool=
|
2011-12-04 18:19:48 +01:00
|
|
|
g_basedir=/usr/share/shorewall
|
2011-12-06 21:54:51 +01:00
|
|
|
g_lite=
|
|
|
|
elif [ $g_program = shorewall6-lite ]; then
|
|
|
|
SHAREDIR=/usr/share/shorewall6-lite
|
|
|
|
CONFDIR=/etc/shorewall6-lite
|
|
|
|
g_product="Shorewall6 Lite"
|
|
|
|
g_family=6
|
|
|
|
g_base=shorewall6
|
|
|
|
g_tool=ip6tables
|
|
|
|
g_basedir=/usr/share/shorewall6-lite
|
|
|
|
g_lite=Yes
|
|
|
|
elif [ $g_program = shorewall-lite ]; then
|
|
|
|
SHAREDIR=/usr/share/shorewall-lite
|
|
|
|
CONFDIR=/etc/shorewall-lite
|
|
|
|
g_product="Shorewall Lite"
|
|
|
|
g_family=4
|
|
|
|
g_base=shorewall
|
|
|
|
g_tool=iptables
|
|
|
|
g_basedir=/usr/share/shorewall-lite
|
|
|
|
g_lite=Yes
|
2011-12-03 22:13:25 +01:00
|
|
|
else
|
|
|
|
g_program=shorewall
|
|
|
|
SHAREDIR=/usr/share/shorewall
|
|
|
|
CONFDIR=/etc/shorewall
|
|
|
|
g_product="Shorewall"
|
|
|
|
g_family=4
|
2011-12-04 18:19:48 +01:00
|
|
|
g_tool=
|
|
|
|
g_basedir=/usr/share/shorewall
|
2011-12-06 21:54:51 +01:00
|
|
|
g_lite=
|
2011-12-03 22:13:25 +01:00
|
|
|
fi
|
|
|
|
|
2011-12-06 21:54:51 +01:00
|
|
|
if [ -z "$g_lite" ]; then
|
|
|
|
for library in base cli cli-std; do
|
|
|
|
. /usr/share/shorewall/lib.$library
|
|
|
|
done
|
|
|
|
else
|
2011-12-11 22:15:30 +01:00
|
|
|
for library in base cli; do
|
2011-12-06 21:54:51 +01:00
|
|
|
. ${SHAREDIR}/lib.$library
|
|
|
|
done
|
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2011-12-20 00:52:42 +01:00
|
|
|
shorewall_cli $@
|