diff --git a/Shorewall-init/init.fedora.sh b/Shorewall-init/init.fedora.sh index a9bd23565..6488a423e 100644 --- a/Shorewall-init/init.fedora.sh +++ b/Shorewall-init/init.fedora.sh @@ -13,6 +13,15 @@ # Description: Place the firewall in a safe state at boot time # prior to bringing up the network. ### END INIT INFO +#determine where the files were installed +if [ -f ~/.shorewallrc ]; then + . ~/.shorewallrc || exit 1 +else + SBINDIR=/sbin + SYSCONFDIR=/etc/default + VARDIR=/var/lib +fi + prog="shorewall-init" logger="logger -i -t $prog" lockfile="/var/lock/subsys/shorewall-init" @@ -44,10 +53,8 @@ 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 - ${vardir}/firewall stop 2>&1 | $logger + if [ -x ${VARDIR}/$product/firewall ]; then + ${VARDIR}/$product/firewall stop 2>&1 | $logger retval=${PIPESTATUS[0]} [ retval -ne 0 ] && break fi @@ -70,10 +77,8 @@ stop () { echo -n "Clearing \"Shorewall-based firewalls\": " for product in $PRODUCTS; do - vardir=/var/lib/$product - [ -f /etc/$product/vardir ] && . /etc/$product/vardir - if [ -x ${vardir}/firewall ]; then - ${vardir}/firewall clear 2>&1 | $logger + if [ -x ${VARDIR}/$product/firewall ]; then + ${VARDIR}/$product/firewall clear 2>&1 | $logger retval=${PIPESTATUS[0]} [ retval -ne 0 ] && break fi diff --git a/Shorewall-lite/init.fedora.sh b/Shorewall-lite/init.fedora.sh index c18529976..c5b10a269 100644 --- a/Shorewall-lite/init.fedora.sh +++ b/Shorewall-lite/init.fedora.sh @@ -20,16 +20,24 @@ # Source function library. . /etc/rc.d/init.d/functions +#determine where the files were installed +if [ -f ~/.shorewallrc ]; then + . ~/.shorewallrc || exit 1 +else + SBINDIR=/sbin + SYSCONFDIR=/etc/default +fi + prog="shorewall-lite" -shorewall="/sbin/$prog" +shorewall="${SBINDIR}/$prog" logger="logger -i -t $prog" lockfile="/var/lock/subsys/$prog" # Get startup options (override default) OPTIONS= -if [ -f /etc/sysconfig/$prog ]; then - . /etc/sysconfig/$prog +if [ -f ${SYSCONFDIR}/$prog ]; then + . ${SYSCONFDIR}/$prog fi start() { diff --git a/Shorewall/init.fedora.sh b/Shorewall/init.fedora.sh index 14bf9830c..a6bd2b73c 100644 --- a/Shorewall/init.fedora.sh +++ b/Shorewall/init.fedora.sh @@ -20,16 +20,24 @@ # Source function library. . /etc/rc.d/init.d/functions +#determine where the files were installed +if [ -f ~/.shorewallrc ]; then + . ~/.shorewallrc || exit 1 +else + SBINDIR=/sbin + SYSCONFDIR=/etc/default +fi + prog="shorewall" -shorewall="/sbin/$prog" +shorewall="${SBINDIR}/$prog" logger="logger -i -t $prog" lockfile="/var/lock/subsys/$prog" # Get startup options (override default) OPTIONS= -if [ -f /etc/sysconfig/$prog ]; then - . /etc/sysconfig/$prog +if [ -f ${SYSCONFDIR}/$prog ]; then + . ${SYSCONFDIR}/$prog fi start() { diff --git a/Shorewall6-lite/init.fedora.sh b/Shorewall6-lite/init.fedora.sh index 13a7019bb..c8912f730 100644 --- a/Shorewall6-lite/init.fedora.sh +++ b/Shorewall6-lite/init.fedora.sh @@ -20,16 +20,24 @@ # Source function library. . /etc/rc.d/init.d/functions +#determine where the files were installed +if [ -f ~/.shorewallrc ]; then + . ~/.shorewallrc || exit 1 +else + SBINDIR=/sbin + SYSCONFDIR=/etc/default +fi + prog="shorewall6-lite" -shorewall="/sbin/$prog" +shorewall="${SBINDIR}/$prog" logger="logger -i -t $prog" lockfile="/var/lock/subsys/$prog" # Get startup options (override default) OPTIONS= -if [ -f /etc/sysconfig/$prog ]; then - . /etc/sysconfig/$prog +if [ -f ${SYSCONFDIR}/$prog ]; then + . ${SYSCONFDIR}/$prog fi start() { diff --git a/Shorewall6/init.fedora.sh b/Shorewall6/init.fedora.sh index cd5896f7b..5aa46aaaa 100644 --- a/Shorewall6/init.fedora.sh +++ b/Shorewall6/init.fedora.sh @@ -20,16 +20,23 @@ # Source function library. . /etc/rc.d/init.d/functions +#determine where the files were installed +if [ -f ~/.shorewallrc ]; then + . ~/.shorewallrc || exit 1 +else + SBINDIR=/sbin + SYSCONFDIR=/etc/default +fi prog="shorewall6" -shorewall="/sbin/$prog" +shorewall="${SBINDIR}/$prog" logger="logger -i -t $prog" lockfile="/var/lock/subsys/$prog" # Get startup options (override default) OPTIONS= -if [ -f /etc/sysconfig/$prog ]; then - . /etc/sysconfig/$prog +if [ -f ${SYSCONFDIR}/$prog ]; then + . ${SYSCONFDIR}/$prog fi start() {