Pave the way for unifying the CLI

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-11-19 21:17:35 -08:00
parent 137b051e52
commit 8b99fe20b5
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10
9 changed files with 34 additions and 22 deletions

View File

@ -79,7 +79,8 @@ if [ -z "$PRODUCT" ]; then
# This is modified by the installer when ${SHAREDIR} != /usr/share
#
. /usr/share/shorewall/shorewallrc
g_readrc=1
g_basedir=${SHAREDIR}/shorewall
setup_environment
fi

View File

@ -27,13 +27,12 @@
SHOREWALL_CAPVERSION=50004
if [ -z "$g_readrc" ]; then
if [ -z "$g_basedir" ]; then
#
# This is modified by the installer when ${SHAREDIR} <> /usr/share
#
. /usr/share/shorewall/shorewallrc
g_readrc=1
g_basedir=${SHAREDIR}/shorewall
fi
@ -4459,7 +4458,22 @@ shorewall_cli() {
g_nopager=Yes
option=${option#p}
;;
6*)
if [ "$PRODUCT" = shorewall ]; then
PRODUCT=shorewall6
elif [ "$PRODUCT" = shorewall-lite ]; then
PRODUCT=shorewall6-lite
fi
option=${option#6}
;;
4*)
if [ "$PRODUCT" = shorewall6 ]; then
PRODUCT=shorewall
elif [ "$PRODUCT" = shorewall6-lite ]; then
PRODUCT=shorewall-lite
fi
option=${option#4}
;;
-)
finished=1
option=

View File

@ -45,19 +45,20 @@
# require Shorewall to be installed.
g_program=shorewall-lite
PRODUCT=shorewall-lite
#
# This is modified by the installer when ${SHAREDIR} != /usr/share
#
. /usr/share/shorewall/shorewallrc
g_sharedir="$SHAREDIR"/shorewall-lite
g_confdir="$CONFDIR"/shorewall-lite
g_readrc=1
g_basedir=${SHAREDIR}/shorewall
. ${SHAREDIR}/shorewall/lib.cli
. /usr/share/shorewall-lite/configpath
setup_environment
. ${SHAREDIR}/shorewall-lite/configpath
[ -n "$PATH" ] || PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin

View File

@ -32,7 +32,6 @@ PRODUCT=shorewall-lite
#
. /usr/share/shorewall/shorewallrc
g_readrc=1
g_basedir=${SHAREDIR}/shorewall
. ${g_basedir}/lib.cli

View File

@ -38,12 +38,11 @@ fi
#
. /usr/share/shorewall/shorewallrc
g_program=$PRODUCT
g_sharedir="$SHAREDIR/shorewall"
g_confdir="$CONFDIR/$PRODUCT"
g_readrc=1
g_basedir=${SHAREDIR}/shorewall
. $g_sharedir/lib.cli
. $g_basedir/lib.cli
setup_environment
CONFIG_PATH="$2"

View File

@ -32,7 +32,6 @@ PRODUCT=shorewall
#
. /usr/share/shorewall/shorewallrc
g_readrc=1
g_basedir=${SHAREDIR}/shorewall
. ${g_basedir}/lib.cli

View File

@ -44,18 +44,19 @@
# used during firewall compilation, then the generated firewall program will likewise not
# require Shorewall to be installed.
g_program=shorewall6-lite
PRODUCT=shorewall6-lite
#
# This is modified by the installer when ${SHAREDIR} != /usr/share
#
. /usr/share/shorewall/shorewallrc
g_sharedir="$SHAREDIR"/shorewall6-lite
g_confdir="$CONFDIR"/shorewall6-lite
g_readrc=1
g_basedir=${SHAREDIR}/shorewall
. ${SHAREDIR}/shorewall/lib.cli
setup_environment
. ${SHAREDIR}/shorewall-lite/configpath
[ -n "$PATH" ] || PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin

View File

@ -33,7 +33,6 @@ PRODUCT=shorewall6-lite
. /usr/share/shorewall/shorewallrc
g_basedir=${SHAREDIR}/shorewall
g_readrc=1
. ${g_basedir}/lib.cli

View File

@ -32,7 +32,6 @@ PRODUCT=shorewall6
#
. /usr/share/shorewall/shorewallrc
g_readrc=1
g_basedir=${SHAREDIR}/shorewall
. ${g_basedir}/lib.cli