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