mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-08 08:44:05 +01:00
Shorewall-init ppp support on Debian
This commit is contained in:
parent
5ad06291c8
commit
4bcfb8dea6
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
IFUPDOWN=0
|
IFUPDOWN=0
|
||||||
PRODUCTS=
|
PRODUCTS=
|
||||||
|
SAVEPRODUCTS="$PRODUCTS"
|
||||||
|
|
||||||
if [ -f /etc/default/shorewall-init ]; then
|
if [ -f /etc/default/shorewall-init ]; then
|
||||||
. /etc/default/shorewall-init
|
. /etc/default/shorewall-init
|
||||||
@ -34,22 +35,70 @@ fi
|
|||||||
[ "$IFUPDOWN" = 1 -a -n "$PRODUCTS" ] || exit 0
|
[ "$IFUPDOWN" = 1 -a -n "$PRODUCTS" ] || exit 0
|
||||||
|
|
||||||
if [ -f /etc/debian_version ]; then
|
if [ -f /etc/debian_version ]; then
|
||||||
#
|
case $0 in
|
||||||
# Debian ifupdown system
|
/etc/ppp*)
|
||||||
#
|
#
|
||||||
INTERFACE="$IFACE"
|
# Debian ppp
|
||||||
|
#
|
||||||
|
PRODUCTS=
|
||||||
|
INTERFACE="$1"
|
||||||
|
|
||||||
if [ "$MODE" = start ]; then
|
case $0 in
|
||||||
COMMAND=up
|
/etc/ppp/ip-*)
|
||||||
elif [ "$MODE" = stop ]; then
|
#
|
||||||
COMMAND=down
|
# IPv4
|
||||||
else
|
#
|
||||||
exit 0
|
for product in $PRODUCTS; do
|
||||||
fi
|
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
|
case $0 in
|
||||||
pre-*)
|
*up/*)
|
||||||
exit 0
|
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
|
esac
|
||||||
elif [ -f /etc/SuSE-release ]; then
|
elif [ -f /etc/SuSE-release ]; then
|
||||||
|
@ -289,6 +289,12 @@ if [ -z "$DESTDIR" ]; then
|
|||||||
update-rc.d shorewall-init defaults
|
update-rc.d shorewall-init defaults
|
||||||
|
|
||||||
echo "Shorewall Init will start automatically at boot"
|
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
|
else
|
||||||
if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then
|
if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then
|
||||||
if insserv /etc/init.d/shorewall-init ; then
|
if insserv /etc/init.d/shorewall-init ; then
|
||||||
@ -325,6 +331,12 @@ else
|
|||||||
echo "Shorewall Init will start automatically at boot"
|
echo "Shorewall Init will start automatically at boot"
|
||||||
fi
|
fi
|
||||||
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
|
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-up.d/shorewall
|
||||||
remove_file /etc/sysconfig/network/if-down.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
|
rm -rf /usr/share/shorewall-init
|
||||||
|
|
||||||
echo "Shorewall Init Uninstalled"
|
echo "Shorewall Init Uninstalled"
|
||||||
|
Loading…
Reference in New Issue
Block a user