diff --git a/Shorewall-init/ifupdown.sh b/Shorewall-init/ifupdown.sh index 3219ccea6..9689e2ddb 100644 --- a/Shorewall-init/ifupdown.sh +++ b/Shorewall-init/ifupdown.sh @@ -24,6 +24,7 @@ IFUPDOWN=0 PRODUCTS= +SAVEPRODUCTS="$PRODUCTS" if [ -f /etc/default/shorewall-init ]; then . /etc/default/shorewall-init @@ -34,22 +35,70 @@ fi [ "$IFUPDOWN" = 1 -a -n "$PRODUCTS" ] || exit 0 if [ -f /etc/debian_version ]; then - # - # Debian ifupdown system - # - INTERFACE="$IFACE" + case $0 in + /etc/ppp*) + # + # Debian ppp + # + PRODUCTS= + INTERFACE="$1" - if [ "$MODE" = start ]; then - COMMAND=up - elif [ "$MODE" = stop ]; then - COMMAND=down - else - exit 0 - fi + case $0 in + /etc/ppp/ip-*) + # + # IPv4 + # + for product in $PRODUCTS; do + case $product in + shorewall|shorewall-lite) + PRODUCTS="$PRODUCTS $product"; + ;; + esac + done + ;; + *) + # + # IPv6 + # + for product in $PRODUCTS; do + case $product in + shorewall6|shorewall6-lite) + PRODUCTS="$PRODUCTS $product"; + ;; + esac + done + ;; + esac - case "$PHASE" in - pre-*) - exit 0 + case $0 in + *up/*) + COMMAND=up + ;; + *) + COMMAND=down + ;; + esac + ;; + + *) + # + # Debian ifupdown system + # + INTERFACE="$IFACE" + + if [ "$MODE" = start ]; then + COMMAND=up + elif [ "$MODE" = stop ]; then + COMMAND=down + else + exit 0 + fi + + case "$PHASE" in + pre-*) + exit 0 + ;; + esac ;; esac elif [ -f /etc/SuSE-release ]; then diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index 9c652a476..511cfa451 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -289,6 +289,12 @@ if [ -z "$DESTDIR" ]; then update-rc.d shorewall-init defaults echo "Shorewall Init will start automatically at boot" + + if [ -d /etc/ppp ]; then + for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do + [ -d /etc/ppp/$directory ] && ln -sf /usr/share/shorewall-init/ifupdown /etc/ppp/$directory/shorewall + done + fi else if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then if insserv /etc/init.d/shorewall-init ; then @@ -325,6 +331,12 @@ else echo "Shorewall Init will start automatically at boot" fi fi + + if [ -n "$DEBIAN" ] -a -d /etc/ppp ]; then + for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do + [ -d /etc/ppp/$directory ] && ln -sf /usr/share/shorewall-init/ifupdown /etc/ppp/$directory/shorewall + done + fi fi # diff --git a/Shorewall-init/uninstall.sh b/Shorewall-init/uninstall.sh index a47649fcd..6d4d23692 100755 --- a/Shorewall-init/uninstall.sh +++ b/Shorewall-init/uninstall.sh @@ -90,6 +90,12 @@ remove_file /etc/network/if-down.d/shorewall remove_file /etc/sysconfig/network/if-up.d/shorewall remove_file /etc/sysconfig/network/if-down.d/shorewall +if [ -d /etc/ppp ]; then + for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do + remove_file /etc/ppp/$directory/shorewall + done +fi + rm -rf /usr/share/shorewall-init echo "Shorewall Init Uninstalled"