Add shorewallrc processing to other CLI programs

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-03-24 22:14:01 -07:00
parent 173d29969d
commit 877796a7ca
3 changed files with 46 additions and 4 deletions

View File

@ -23,9 +23,15 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#########################################################################################
if [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
else
echo "ERROR: ./.shorewallrc not found" >&2
fi
# check if shorewall-init is configured or not
if [ -f "/etc/sysconfig/shorewall-init" ]; then
. /etc/sysconfig/shorewall-init
if [ -f "$SYSCONFDIR/shorewall-init" ]; then
. $SYSCONFDIR/shorewall-init
if [ -z "$PRODUCTS" ]; then
echo "ERROR: No products configured" >&2
exit 1

View File

@ -27,6 +27,24 @@
################################################################################################
g_program=shorewall6-lite
. /usr/share/shorewall/lib.cli
if [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
else
SHAREDIR=/usr/share
CONFDIR=${CONFDIR}
SBINDIR=/sbin
VARDIR=/var/lib
LIBEXECDIR=/usr/share
PERLLIBDIR=/usr/share/shorewall
fi
g_libexec="$LIBEXECDIR"
g_sharedir="$SHAREDIR"
g_sbindir="$SBINDIR"
g_perllib="$PERLLIBDIR"
g_readrc=1
. $g_sharedir/shorewall/lib.cli
shorewall_cli $@

View File

@ -27,6 +27,24 @@
################################################################################################
g_program=shorewall6
. /usr/share/shorewall/lib.cli
if [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
else
SHAREDIR=/usr/share
CONFDIR=${CONFDIR}
SBINDIR=/sbin
VARDIR=/var/lib
LIBEXECDIR=/usr/share
PERLLIBDIR=/usr/share/shorewall
fi
g_libexec="$LIBEXECDIR"
g_sharedir="$SHAREDIR"
g_sbindir="$SBINDIR"
g_perllib="$PERLLIBDIR"
g_readrc=1
. $g_sharedir/shorewall/lib.cli
shorewall_cli $@