diff --git a/Shorewall-init/shorewall-init b/Shorewall-init/shorewall-init index 95c8d74fc..f34de5ee0 100644 --- a/Shorewall-init/shorewall-init +++ b/Shorewall-init/shorewall-init @@ -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 diff --git a/Shorewall6-lite/shorewall6-lite b/Shorewall6-lite/shorewall6-lite index 7cca499cc..f38677915 100755 --- a/Shorewall6-lite/shorewall6-lite +++ b/Shorewall6-lite/shorewall6-lite @@ -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 $@ diff --git a/Shorewall6/shorewall6 b/Shorewall6/shorewall6 index d7e0d7a29..329f84f26 100755 --- a/Shorewall6/shorewall6 +++ b/Shorewall6/shorewall6 @@ -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 $@