forked from extern/shorewall_code
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.
|
# 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
|
# check if shorewall-init is configured or not
|
||||||
if [ -f "/etc/sysconfig/shorewall-init" ]; then
|
if [ -f "$SYSCONFDIR/shorewall-init" ]; then
|
||||||
. /etc/sysconfig/shorewall-init
|
. $SYSCONFDIR/shorewall-init
|
||||||
if [ -z "$PRODUCTS" ]; then
|
if [ -z "$PRODUCTS" ]; then
|
||||||
echo "ERROR: No products configured" >&2
|
echo "ERROR: No products configured" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -27,6 +27,24 @@
|
|||||||
################################################################################################
|
################################################################################################
|
||||||
g_program=shorewall6-lite
|
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 $@
|
shorewall_cli $@
|
||||||
|
@ -27,6 +27,24 @@
|
|||||||
################################################################################################
|
################################################################################################
|
||||||
g_program=shorewall6
|
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 $@
|
shorewall_cli $@
|
||||||
|
Loading…
Reference in New Issue
Block a user