mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-21 23:23:13 +01:00
Implement (untested) support for SuSE in shorewall-init
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
9f535b670d
commit
9d3d66d4a2
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# ifup script for Shorewall-based products
|
||||
# ifupdown script for Shorewall-based products
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
@ -50,16 +50,33 @@ if [ -f /etc/debian_version ]; then
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
elif [ -f /etc/SuSE-release ]; then
|
||||
#
|
||||
# SuSE ifupdown system
|
||||
#
|
||||
$IFACE = "$2"
|
||||
|
||||
for PRODUCT in $PRODUCTS; do
|
||||
VARDIR=/var/lib/$PRODUCT
|
||||
[ -f /etc/$PRODUCT/vardir ] && . /etc/$PRODUCT/vardir
|
||||
if [ -x $VARDIR/firewall ]; then
|
||||
$VARDIR/firewall -V0 $COMMAND $IFACE
|
||||
fi
|
||||
done
|
||||
|
||||
case $0 in
|
||||
*if-up.d*)
|
||||
COMMAND=up
|
||||
;;
|
||||
*if-down.d*)
|
||||
COMMAND=down
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for PRODUCT in $PRODUCTS; do
|
||||
VARDIR=/var/lib/$PRODUCT
|
||||
[ -f /etc/$PRODUCT/vardir ] && . /etc/$PRODUCT/vardir
|
||||
if [ -x $VARDIR/firewall ]; then
|
||||
$VARDIR/firewall -V0 $COMMAND $IFACE
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
@ -130,6 +130,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
||||
# Determine where to install the firewall script
|
||||
#
|
||||
DEBIAN=
|
||||
SUSE=
|
||||
|
||||
case $(uname) in
|
||||
*)
|
||||
@ -149,6 +150,8 @@ if [ -n "$PREFIX" ]; then
|
||||
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST}
|
||||
elif [ -f /etc/debian_version ]; then
|
||||
DEBIAN=yes
|
||||
elif [ -f /etc/SuSE-release ]; then
|
||||
SUSE=Yes
|
||||
elif [ -f /etc/slackware-version ] ; then
|
||||
DEST="/etc/rc.d"
|
||||
INIT="rc.firewall"
|
||||
@ -231,6 +234,11 @@ if [ -z "$PREFIX" ]; then
|
||||
ln -sf /usr/share/shorewall-init/ifupdown /etc/network/if-post-down.d/shorewall
|
||||
echo "Shorewall Init will start automatically at boot"
|
||||
else
|
||||
if [ -n "$SUSE" ]; THEN
|
||||
ln -sf /usr/share/shorewall-init/ifupdown /etc/sysconfig/network/if-up.d/shorewall
|
||||
ln -sf /usr/share/shorewall-init/ifupdown /etc/sysconfig/network/if-down.d/shorewall
|
||||
fi
|
||||
|
||||
if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then
|
||||
if insserv /etc/init.d/shorewall-init ; then
|
||||
echo "Shorewall Init will start automatically at boot"
|
||||
|
Loading…
Reference in New Issue
Block a user