mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-22 15:43:30 +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
|
#!/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]
|
# 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
|
exit 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
elif [ -f /etc/SuSE-release ]; then
|
||||||
|
#
|
||||||
|
# SuSE ifupdown system
|
||||||
|
#
|
||||||
|
$IFACE = "$2"
|
||||||
|
|
||||||
for PRODUCT in $PRODUCTS; do
|
case $0 in
|
||||||
VARDIR=/var/lib/$PRODUCT
|
*if-up.d*)
|
||||||
[ -f /etc/$PRODUCT/vardir ] && . /etc/$PRODUCT/vardir
|
COMMAND=up
|
||||||
if [ -x $VARDIR/firewall ]; then
|
;;
|
||||||
$VARDIR/firewall -V0 $COMMAND $IFACE
|
*if-down.d*)
|
||||||
fi
|
COMMAND=down
|
||||||
done
|
;;
|
||||||
|
*)
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
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
|
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
|
# Determine where to install the firewall script
|
||||||
#
|
#
|
||||||
DEBIAN=
|
DEBIAN=
|
||||||
|
SUSE=
|
||||||
|
|
||||||
case $(uname) in
|
case $(uname) in
|
||||||
*)
|
*)
|
||||||
@ -149,6 +150,8 @@ if [ -n "$PREFIX" ]; then
|
|||||||
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST}
|
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST}
|
||||||
elif [ -f /etc/debian_version ]; then
|
elif [ -f /etc/debian_version ]; then
|
||||||
DEBIAN=yes
|
DEBIAN=yes
|
||||||
|
elif [ -f /etc/SuSE-release ]; then
|
||||||
|
SUSE=Yes
|
||||||
elif [ -f /etc/slackware-version ] ; then
|
elif [ -f /etc/slackware-version ] ; then
|
||||||
DEST="/etc/rc.d"
|
DEST="/etc/rc.d"
|
||||||
INIT="rc.firewall"
|
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
|
ln -sf /usr/share/shorewall-init/ifupdown /etc/network/if-post-down.d/shorewall
|
||||||
echo "Shorewall Init will start automatically at boot"
|
echo "Shorewall Init will start automatically at boot"
|
||||||
else
|
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 [ -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
|
||||||
echo "Shorewall Init will start automatically at boot"
|
echo "Shorewall Init will start automatically at boot"
|
||||||
|
Loading…
Reference in New Issue
Block a user