mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 06:10:42 +01:00
Shorewall-init ppp support on Debian
This commit is contained in:
parent
5ad06291c8
commit
4bcfb8dea6
@ -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
|
||||
|
@ -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
|
||||
|
||||
#
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user