From 70bb9147cdf7a33ffd965b7d0bae5e886fe7df41 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 4 Oct 2014 09:00:12 -0700 Subject: [PATCH] Correct Shorewall-init installer handling of SANDBOX Signed-off-by: Tom Eastep --- Shorewall-init/install.sh | 37 +++++++++++++++++++++++++++++++------ Shorewall-init/uninstall.sh | 3 +-- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index 13a1a3287..9374f324b 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -376,6 +376,9 @@ if [ $HOST = debian ]; then if [ -n "${DESTDIR}" ]; then mkdir -p ${DESTDIR}/etc/network/if-up.d/ mkdir -p ${DESTDIR}/etc/network/if-down.d/ + elif [ $configure -eq 0 ]; then + mkdir -p ${DESTDIR}/${CONFDIR}/network/if-up.d/ + mkdir -p ${DESTDIR}/${CONFDIR}/network/if-down.d/ fi if [ ! -f ${DESTDIR}/etc/default/shorewall-init ]; then @@ -383,7 +386,11 @@ if [ $HOST = debian ]; then mkdir ${DESTDIR}/etc/default fi - install_file sysconfig ${DESTDIR}/etc/default/shorewall-init 0644 + if [ $configure -eq 1 ]; then + install_file sysconfig ${DESTDIR}/etc/default/shorewall-init 0644 + else + install_file sysconfig ${DESTDIR}${CONFDIR}/default/shorewall-init 0644 + fi fi IFUPDOWN=ifupdown.debian.sh @@ -394,7 +401,7 @@ else if [ -z "$RPM" ]; then if [ $HOST = suse ]; then mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d - mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-down.d + mkdir -p ${DESTDIR}/etc/sysconfig/network/if-down.d elif [ $HOST = gentoo ]; then # Gentoo does not support if-{up,down}.d /bin/true @@ -425,17 +432,35 @@ mkdir -p ${DESTDIR}${LIBEXECDIR}/shorewall-init install_file ifupdown ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown 0544 if [ -d ${DESTDIR}/etc/NetworkManager ]; then - install_file ifupdown ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544 + if [ $configure -eq 1 ]; then + install_file ifupdown ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544 + else + mkdir -p ${DESTDIR}${CONFIGDIR}/NetworkManager/dispatcher.d/ + install_file ifupdown ${DESTDIR}${CONFIGDIR}/NetworkManager/dispatcher.d/01-shorewall 0544 + fi fi case $HOST in debian) - install_file ifupdown ${DESTDIR}/etc/network/if-up.d/shorewall 0544 - install_file ifupdown ${DESTDIR}/etc/network/if-down.d/shorewall 0544 - install_file ifupdown ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544 + if [ $configure -eq 1 ]; then + install_file ifupdown ${DESTDIR}/etc/network/if-up.d/shorewall 0544 + install_file ifupdown ${DESTDIR}/etc/network/if-down.d/shorewall 0544 + install_file ifupdown ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544 + else + mkdir -p ${DESTDIR}${CONFIGDIR}/network/if-up.d/ + mkdir -p ${DESTDIR}${CONFIGDIR}/network/if-down.d/ + install_file ifupdown ${DESTDIR}${CONFIGDIR}/network/if-up.d/shorewall 0544 + install_file ifupdown ${DESTDIR}${CONFIGDIR}/network/if-down.d/shorewall 0544 + install_file ifupdown ${DESTDIR}${CONFIGDIR}/network/if-post-down.d/shorewall 0544 + fi ;; suse) if [ -z "$RPM" ]; then + if [ $configure -eq 0 ]; then + mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-up.d/ + mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-down.d/ + fi + install_file ifupdown ${DESTDIR}${SYSCONFDIR}/network/if-up.d/shorewall 0544 install_file ifupdown ${DESTDIR}${SYSCONFDIR}/network/if-down.d/shorewall 0544 fi diff --git a/Shorewall-init/uninstall.sh b/Shorewall-init/uninstall.sh index 7cd391001..df72cce9f 100755 --- a/Shorewall-init/uninstall.sh +++ b/Shorewall-init/uninstall.sh @@ -1,4 +1,4 @@ -\#!/bin/sh +#!/bin/sh # # Script to back uninstall Shoreline Firewall # @@ -88,7 +88,6 @@ while [ $finished -eq 0 ]; do echo "$Product Firewall Installer Version $VERSION" exit 0 ;; - ;; n*) configure=0 option=${option#n}