diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index d24d98c43..c4c3d4335 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -169,7 +169,7 @@ if [ -z "$BUILD" ]; then ;; *) if [ -f /etc/os-release ]; then - eval $(cat /etc/os-release | grep ^ID=) + ID=$(grep '^ID=' /etc/os-release | sed 's/ID=//; s/"//g;') case $ID in fedora|rhel|centos|foobar) @@ -357,12 +357,11 @@ fi if [ $HOST = debian ]; then if [ -n "${DESTDIR}" ]; then make_parent_directory ${DESTDIR}${ETC}/network/if-up.d 0755 - make_parent_directory ${DESTDIR}${ETC}/network/if-down.d 0755 make_parent_directory ${DESTDIR}${ETC}/network/if-post-down.d 0755 elif [ $configure -eq 0 ]; then - make_parent_directory ${DESTDIR}${CONFDIR}/network/if-up.d 0755 - make_parent_directory ${DESTDIR}${CONFDIR}/network/if-down.d 0755 - make_parent_directory ${DESTDIR}${CONFDIR}/network/if-post-down.d 0755 + make_parent_directory ${CONFDIR}/network/if-up.d 0755 + make_parent_directory ${CONFDIR}/network/if-post-down.d 0755 + rm -f ${CONFDIR}/network/if-down.d/shorewall fi if [ ! -f ${DESTDIR}${CONFDIR}/default/$PRODUCT ]; then @@ -388,7 +387,7 @@ else elif [ $HOST = openwrt ]; then # Not implemented on OpenWRT /bin/true - else + elif [ "$HOST" != debian ]; then make_parent_directory ${DESTDIR}/${ETC}/NetworkManager/dispatcher.d 0755 fi fi @@ -417,19 +416,21 @@ if [ $HOST != openwrt ]; then fi if [ -d ${DESTDIR}/etc/NetworkManager ]; then - [ $configure -eq 1 ] || make_parent_directory ${DESTDIR}${CONFDIR}/NetworkManager/dispatcher.d 0755 - install_file ifupdown ${DESTDIR}${ETC}/NetworkManager/dispatcher.d/01-shorewall 0544 + if [ "$HOST" = debian ]; then + rm -f ${DESTDIR}${ETC}/NetworkManager/dispatcher.d/01-shorewall + else + [ $configure -eq 1 ] || make_parent_directory ${DESTDIR}${CONFDIR}/NetworkManager/dispatcher.d 0755 + install_file ifupdown ${DESTDIR}${ETC}/NetworkManager/dispatcher.d/01-shorewall 0544 + fi fi case $HOST in debian) 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 install_file ifupdown ${DESTDIR}${CONFDIR}/network/if-up.d/shorewall 0544 - install_file ifupdown ${DESTDIR}${CONFDIR}/network/if-down.d/shorewall 0544 install_file ifupdown ${DESTDIR}${CONFDIR}/network/if-post-down.d/shorewall 0544 fi ;; diff --git a/Shorewall/Perl/Shorewall/Providers.pm b/Shorewall/Perl/Shorewall/Providers.pm index 4f4ad59bb..5c14daf47 100644 --- a/Shorewall/Perl/Shorewall/Providers.pm +++ b/Shorewall/Perl/Shorewall/Providers.pm @@ -2069,7 +2069,7 @@ sub compile_updown() { q( COMMAND=enable) , q( detect_configuration $1), q( enable_provider $1), - q( elif [ "$PHASE" != post-down ]; then # pre-down or not Debian) , + q( else ), q( progress_message3 "Attempting disable on interface $1") , q( COMMAND=disable) , q( detect_configuration $1),