mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-22 07:33:43 +01:00
Add shorewallrc processing to other CLI programs
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
173d29969d
commit
877796a7ca
@ -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
|
||||
|
@ -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 $@
|
||||
|
@ -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 $@
|
||||
|
Loading…
Reference in New Issue
Block a user