diff --git a/Shorewall-lite/shorewall-lite b/Shorewall-lite/shorewall-lite index fc6ffcd4d..eeb976bd9 100755 --- a/Shorewall-lite/shorewall-lite +++ b/Shorewall-lite/shorewall-lite @@ -448,6 +448,25 @@ g_recovering= g_purge= g_logread= +g_program=$(basename $0) + +if [ $g_program = shorewall6-lite ]; then + SHAREDIR=/usr/share/shorewall6-lite + CONFDIR=/etc/shorewall6-lite + g_product="Shorewall6 Lite" + g_family=6 + g_base=shorewall6 + g_tool=ip6tables +else + g_program=shorewall-lite + SHAREDIR=/usr/share/shorewall-lite + CONFDIR=/etc/shorewall-lite + g_product="Shorewall Lite" + g_family=4 + g_base=shorewall + g_tool=iptables +fi + # # Make sure that these variables are cleared # @@ -539,25 +558,6 @@ fi PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin MUTEX_TIMEOUT= -g_program=$(basename $0) - -if [ $g_program = shorewall6-lite ]; then - SHAREDIR=/usr/share/shorewall6-lite - CONFDIR=/etc/shorewall6-lite - g_product="Shorewall6 Lite" - g_family=6 - g_base=shorewall6 - g_tool=ip6tables -else - g_program=shorewall-lite - SHAREDIR=/usr/share/shorewall-lite - CONFDIR=/etc/shorewall-lite - g_product="Shorewall Lite" - g_family=4 - g_base=shorewall - g_tool=iptables -fi - g_libexec=share [ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir ] diff --git a/Shorewall/lib.base b/Shorewall/lib.base index eff439e95..eecc442e8 100644 --- a/Shorewall/lib.base +++ b/Shorewall/lib.base @@ -32,7 +32,7 @@ SHOREWALL_CAPVERSION=40426 [ -n "${g_program:=shorewall}" ] [ -n "${VARDIR:=/var/lib/$g_program}" ] -[ -n "${SHAREDIR:=/usr/share/g_program}" ] +[ -n "${SHAREDIR:=/usr/share/$g_program}" ] [ -n "${CONFDIR:=/etc/$g_program}" ] # diff --git a/Shorewall/shorewall b/Shorewall/shorewall index e40aabe7f..dd0c74f62 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -1690,6 +1690,22 @@ g_annotate= VERBOSE= VERBOSITY= +g_program=$(basename $0) + +if [ $g_program = shorewall6 ]; then + SHAREDIR=/usr/share/shorewall6 + CONFDIR=/etc/shorewall6 + g_product="Shorewall6" + g_family=6 + g_tool= +else + g_program=shorewall + SHAREDIR=/usr/share/shorewall + CONFDIR=/etc/shorewall + g_product="Shorewall" + g_family=4 +fi + finished=0 while [ $finished -eq 0 ]; do @@ -1792,22 +1808,6 @@ fi PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin MUTEX_TIMEOUT= -g_program=$(basename $0) - -if [ $g_program = shorewall6 ]; then - SHAREDIR=/usr/share/shorewall6 - CONFDIR=/etc/shorewall6 - g_product="Shorewall6" - g_family=6 - g_tool= -else - g_program=shorewall - SHAREDIR=/usr/share/shorewall - CONFDIR=/etc/shorewall - g_product="Shorewall" - g_family=4 -fi - g_recovering= g_timestamp= g_libexec=/usr/share