forked from extern/shorewall_code
Look in additional places for .shorewallrc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
fd82877312
commit
7b9c1d43cd
@ -315,8 +315,8 @@ chmod 644 ${DESTDIR}${SHAREDIR}/shorewall/coreversion
|
|||||||
|
|
||||||
cp $file ${DESTDIR}${SHAREDIR}/shorewall/shorewallrc
|
cp $file ${DESTDIR}${SHAREDIR}/shorewall/shorewallrc
|
||||||
|
|
||||||
if [ -z "${DESTDIR}" ]; then
|
if [ -z "${DESTDIR}" -n ${HOME} ]; then
|
||||||
[ -f ~/.shorewallrc ] || cp $file ~/.shorewallrc
|
[ -f ${HOME}/.shorewallrc ] || cp $file ${HOME}/.shorewallrc
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
# Report Success
|
# Report Success
|
||||||
|
@ -33,8 +33,17 @@ SHOREWALL_CAPVERSION=40502
|
|||||||
[ -n "${g_program:=shorewall}" ]
|
[ -n "${g_program:=shorewall}" ]
|
||||||
|
|
||||||
if [ -z "$g_readrc" ]; then
|
if [ -z "$g_readrc" ]; then
|
||||||
if [ -f ~/.shorewallrc ]; then
|
|
||||||
|
if [ -f ./.shorewallrc ]; then
|
||||||
. ~/.shorewallrc || exit 1
|
. ~/.shorewallrc || exit 1
|
||||||
|
elif [ -r /root/.shorewallrc ]; then
|
||||||
|
. /root/.shorewallrc || exit 1
|
||||||
|
elif [ -r /.shorewallrc ]; then
|
||||||
|
. /root/.shorewallrc || exit 1
|
||||||
|
elif [ -f ~/.shorewallrc ]; then
|
||||||
|
. ~/.shorewallrc || exit 1
|
||||||
|
elif - -f ${SHOREAWLLRC_HOME}/.shorewallrc; then
|
||||||
|
. ${SHOREAWLLRC_HOME}/.shorewallrc || exit 1
|
||||||
else
|
else
|
||||||
SHAREDIR=/usr/share
|
SHAREDIR=/usr/share
|
||||||
CONFDIR=/etc
|
CONFDIR=/etc
|
||||||
@ -471,14 +480,14 @@ mktempfile() {
|
|||||||
else
|
else
|
||||||
case "$MKTEMP" in
|
case "$MKTEMP" in
|
||||||
BSD)
|
BSD)
|
||||||
mktemp /tmp/shorewall.XXXXXX
|
mktemp ${TMPDIR:-/tmp}/shorewall.XXXXXX
|
||||||
;;
|
;;
|
||||||
STD)
|
STD)
|
||||||
mktemp -t shorewall.XXXXXX
|
mktemp -t shorewall.XXXXXX
|
||||||
;;
|
;;
|
||||||
None)
|
None)
|
||||||
rm -f /tmp/shorewall-$$
|
rm -f ${TMPDIR:-/tmp}/shorewall-$$
|
||||||
> /tmp/shorewall-$$ && echo /tmp/shorewall-$$
|
> ${TMPDIR:-}/shorewall-$$ && echo ${TMPDIR:-/tmp}/shorewall-$$
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error_message "ERROR:Internal error in mktempfile"
|
error_message "ERROR:Internal error in mktempfile"
|
||||||
|
@ -25,8 +25,16 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
if [ -z "$g_readrc" ]; then
|
if [ -z "$g_readrc" ]; then
|
||||||
if [ -f ~/.shorewallrc ]; then
|
if [ -f ./.shorewallrc ]; then
|
||||||
|
. ./.shorewallrc || exit 1
|
||||||
|
elif [ -f ~/.shorewallrc ]; then
|
||||||
. ~/.shorewallrc || exit 1
|
. ~/.shorewallrc || exit 1
|
||||||
|
elif [ -r /root/.shorewallrc ]; then
|
||||||
|
. /root/.shorewallrc || exit 1
|
||||||
|
elif [ -r /.shorewallrc ]; then
|
||||||
|
. /root/.shorewallrc || exit 1
|
||||||
|
elif - -f ${SHOREAWLLRC_HOME}/.shorewallrc; then
|
||||||
|
. ${SHOREAWLLRC_HOME}/.shorewallrc || exit 1
|
||||||
else
|
else
|
||||||
SHAREDIR=/usr/share
|
SHAREDIR=/usr/share
|
||||||
CONFDIR=${CONFDIR}
|
CONFDIR=${CONFDIR}
|
||||||
|
@ -23,10 +23,20 @@
|
|||||||
# 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
|
if [ -f ./.shorewallrc ]; then
|
||||||
|
. ./.shorewallrc || exit 1
|
||||||
|
elif [ -f ~/.shorewallrc ]; then
|
||||||
. ~/.shorewallrc || exit 1
|
. ~/.shorewallrc || exit 1
|
||||||
|
elif [ -r /root/.shorewallrc ]; then
|
||||||
|
. /root/.shorewallrc || exit 1
|
||||||
|
elif [ -r /.shorewallrc ]; then
|
||||||
|
. /root/.shorewallrc || exit 1
|
||||||
|
elif - -f ${SHOREAWLLRC_HOME}/.shorewallrc; then
|
||||||
|
. ${SHOREAWLLRC_HOME}/.shorewallrc || exit 1
|
||||||
else
|
else
|
||||||
echo "ERROR: ./.shorewallrc not found" >&2
|
VARDIR=/var/lib
|
||||||
|
LIBEXECDIR=/usr/share
|
||||||
|
SYSCONFDIR=/etc/sysconfig
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check if shorewall-init is configured or not
|
# check if shorewall-init is configured or not
|
||||||
@ -48,8 +58,6 @@ shorewall_start () {
|
|||||||
|
|
||||||
echo -n "Initializing \"Shorewall-based firewalls\": "
|
echo -n "Initializing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
VARDIR=/var/lib/$PRODUCT
|
|
||||||
[ -f /etc/$PRODUCT/vardir ] && . /etc/$PRODUCT/vardir
|
|
||||||
if [ -x ${VARDIR}/firewall ]; then
|
if [ -x ${VARDIR}/firewall ]; then
|
||||||
if ! /sbin/$PRODUCT status > /dev/null 2>&1; then
|
if ! /sbin/$PRODUCT status > /dev/null 2>&1; then
|
||||||
${VARDIR}/firewall stop || exit 1
|
${VARDIR}/firewall stop || exit 1
|
||||||
|
@ -27,8 +27,16 @@
|
|||||||
################################################################################################
|
################################################################################################
|
||||||
g_program=shorewall-lite
|
g_program=shorewall-lite
|
||||||
|
|
||||||
if [ -f ~/.shorewallrc ]; then
|
if [ -f ./.shorewallrc ]; then
|
||||||
|
. ./.shorewallrc || exit 1
|
||||||
|
elif [ -f ~/.shorewallrc ]; then
|
||||||
. ~/.shorewallrc || exit 1
|
. ~/.shorewallrc || exit 1
|
||||||
|
elif [ -r /root/.shorewallrc ]; then
|
||||||
|
. /root/.shorewallrc || exit 1
|
||||||
|
elif [ -r /.shorewallrc ]; then
|
||||||
|
. /root/.shorewallrc || exit 1
|
||||||
|
elif - -f ${SHOREAWLLRC_HOME}/.shorewallrc; then
|
||||||
|
. ${SHOREAWLLRC_HOME}/.shorewallrc || exit 1
|
||||||
else
|
else
|
||||||
SHAREDIR=/usr/share
|
SHAREDIR=/usr/share
|
||||||
CONFDIR=${CONFDIR}
|
CONFDIR=${CONFDIR}
|
||||||
|
@ -27,8 +27,16 @@
|
|||||||
################################################################################################
|
################################################################################################
|
||||||
g_program=shorewall
|
g_program=shorewall
|
||||||
|
|
||||||
if [ -f ~/.shorewallrc ]; then
|
if [ -f ./.shorewallrc ]; then
|
||||||
|
. ./.shorewallrc || exit 1
|
||||||
|
elif [ -f ~/.shorewallrc ]; then
|
||||||
. ~/.shorewallrc || exit 1
|
. ~/.shorewallrc || exit 1
|
||||||
|
elif [ -r /root/.shorewallrc ]; then
|
||||||
|
. /root/.shorewallrc || exit 1
|
||||||
|
elif [ -r /.shorewallrc ]; then
|
||||||
|
. /root/.shorewallrc || exit 1
|
||||||
|
elif - -f ${SHOREAWLLRC_HOME}/.shorewallrc; then
|
||||||
|
. ${SHOREAWLLRC_HOME}/.shorewallrc || exit 1
|
||||||
else
|
else
|
||||||
SHAREDIR=/usr/share
|
SHAREDIR=/usr/share
|
||||||
CONFDIR=${CONFDIR}
|
CONFDIR=${CONFDIR}
|
||||||
@ -36,7 +44,6 @@ else
|
|||||||
VARDIR=/var/lib
|
VARDIR=/var/lib
|
||||||
LIBEXECDIR=/usr/share
|
LIBEXECDIR=/usr/share
|
||||||
PERLLIBDIR=/usr/share/shorewall
|
PERLLIBDIR=/usr/share/shorewall
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
g_libexec="$LIBEXECDIR"
|
g_libexec="$LIBEXECDIR"
|
||||||
|
Loading…
Reference in New Issue
Block a user