2010-01-12 15:48:48 +01:00
|
|
|
Index: ebtables.sysv
|
|
|
|
===================================================================
|
|
|
|
--- ebtables.sysv.orig
|
2007-10-13 00:07:43 +02:00
|
|
|
+++ ebtables.sysv
|
2010-01-12 15:48:48 +01:00
|
|
|
@@ -11,12 +11,15 @@
|
2007-10-13 00:07:43 +02:00
|
|
|
#
|
|
|
|
# config: __SYSCONFIG__/ebtables (text)
|
|
|
|
# __SYSCONFIG__/ebtables.<table> (binary)
|
2010-01-12 15:48:48 +01:00
|
|
|
-
|
|
|
|
-source /etc/init.d/functions
|
|
|
|
-source /etc/sysconfig/network
|
|
|
|
-
|
|
|
|
-# Check that networking is up.
|
|
|
|
-[ ${NETWORKING} = "no" ] && exit 0
|
|
|
|
+### BEGIN INIT INFO
|
2011-05-31 14:57:59 +02:00
|
|
|
+# Provides: ebtables
|
2008-09-01 02:30:46 +02:00
|
|
|
+# Required-Start: $remote_fs $network
|
|
|
|
+# Required-Stop: $remote_fs $network
|
2007-10-13 00:07:43 +02:00
|
|
|
+# Short-Description: Ethernet Bridge filter tables
|
|
|
|
+# Description: Ethernet Bridge filter tables
|
2008-09-01 02:30:46 +02:00
|
|
|
+# Default-Start: 2 3 5
|
2010-01-12 15:48:48 +01:00
|
|
|
+# Default-Stop: 0 1 6
|
2007-10-13 00:07:43 +02:00
|
|
|
+### END INIT INFO
|
|
|
|
|
2010-01-12 15:48:48 +01:00
|
|
|
[ -x __EXEC_PATH__/ebtables ] || exit 1
|
|
|
|
[ -x __EXEC_PATH__/ebtables-save ] || exit 1
|
2011-05-31 14:57:59 +02:00
|
|
|
@@ -30,12 +33,15 @@ umask 0077
|
|
|
|
#default configuration
|
|
|
|
EBTABLES_TEXT_FORMAT="yes"
|
|
|
|
EBTABLES_BINARY_FORMAT="yes"
|
|
|
|
-EBTABLES_MODULES_UNLOAD="yes"
|
|
|
|
+EBTABLES_MODULES_UNLOAD="no"
|
|
|
|
EBTABLES_SAVE_ON_STOP="no"
|
2010-01-12 15:48:48 +01:00
|
|
|
EBTABLES_SAVE_ON_RESTART="no"
|
|
|
|
EBTABLES_SAVE_COUNTER="no"
|
|
|
|
|
|
|
|
-config=__SYSCONFIG__/$prog-config
|
|
|
|
+. /etc/rc.status
|
|
|
|
+rc_reset
|
2011-05-31 14:57:59 +02:00
|
|
|
+
|
|
|
|
+config=/etc/sysconfig/ebtables
|
|
|
|
[ -f "$config" ] && . "$config"
|
2010-01-12 15:48:48 +01:00
|
|
|
|
|
|
|
start() {
|
2011-05-31 14:57:59 +02:00
|
|
|
@@ -45,16 +51,15 @@ start() {
|
|
|
|
__EXEC_PATH__/ebtables -t $table --atomic-file __SYSCONFIG__/ebtables.$table --atomic-commit || RETVAL=1
|
|
|
|
done
|
|
|
|
else
|
|
|
|
- __EXEC_PATH__/ebtables-restore < /etc/sysconfig/ebtables || RETVAL=1
|
|
|
|
+ __EXEC_PATH__/ebtables-restore < __SYSCONFIG__/ebtables || RETVAL=1
|
2010-01-12 15:48:48 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $RETVAL -eq 0 ]; then
|
|
|
|
- success "$prog startup"
|
2011-05-31 14:57:59 +02:00
|
|
|
- rm -f /var/lock/subsys/$prog
|
|
|
|
+ touch /var/run/rcebtables
|
|
|
|
+ rc_failed 0
|
2010-01-12 15:48:48 +01:00
|
|
|
else
|
|
|
|
- failure "$prog startup"
|
|
|
|
+ rc_failed 3
|
|
|
|
fi
|
2011-05-31 14:57:59 +02:00
|
|
|
- echo
|
2010-01-12 15:48:48 +01:00
|
|
|
}
|
2011-05-31 14:57:59 +02:00
|
|
|
|
|
|
|
stop() {
|
|
|
|
@@ -70,17 +75,18 @@ stop() {
|
2010-01-12 15:48:48 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $RETVAL -eq 0 ]; then
|
|
|
|
- success "$prog shutdown"
|
2011-05-31 14:57:59 +02:00
|
|
|
- rm -f /var/lock/subsys/$prog
|
|
|
|
+ rm -f /var/run/rcebtables
|
|
|
|
+ rc_failed 0
|
2010-01-12 15:48:48 +01:00
|
|
|
else
|
|
|
|
- failure "$prog shutdown"
|
|
|
|
+ rc_failed 3
|
|
|
|
fi
|
2011-05-31 14:57:59 +02:00
|
|
|
- echo
|
|
|
|
}
|
|
|
|
|
|
|
|
restart() {
|
|
|
|
stop
|
|
|
|
+ rc_status -v
|
|
|
|
start
|
|
|
|
+ rc_status -v
|
2010-01-12 15:48:48 +01:00
|
|
|
}
|
2011-05-31 14:57:59 +02:00
|
|
|
|
|
|
|
save() {
|
|
|
|
@@ -106,40 +112,42 @@ save() {
|
|
|
|
done
|
2010-01-12 15:48:48 +01:00
|
|
|
fi
|
|
|
|
|
2011-05-31 14:57:59 +02:00
|
|
|
- if [ $RETVAL -eq 0 ]; then
|
2010-01-12 15:48:48 +01:00
|
|
|
- success "$prog saved"
|
2011-05-31 14:57:59 +02:00
|
|
|
- else
|
2010-01-12 15:48:48 +01:00
|
|
|
- failure "$prog saved"
|
2011-05-31 14:57:59 +02:00
|
|
|
+ if [ $RETVAL -ne 0 ]; then
|
2010-01-12 15:48:48 +01:00
|
|
|
+ rc_failed 3
|
|
|
|
fi
|
2011-05-31 14:57:59 +02:00
|
|
|
- echo
|
2010-01-12 15:48:48 +01:00
|
|
|
}
|
2011-05-31 14:57:59 +02:00
|
|
|
|
2010-01-12 15:48:48 +01:00
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
+ rc_status -v
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
[ "$EBTABLES_SAVE_ON_STOP" = "yes" ] && save
|
|
|
|
stop
|
|
|
|
+ rc_status -v
|
|
|
|
;;
|
|
|
|
restart|reload)
|
|
|
|
[ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save
|
|
|
|
restart
|
|
|
|
;;
|
2011-05-31 14:57:59 +02:00
|
|
|
- condrestart)
|
|
|
|
- [ -e /var/lock/subsys/$prog ] && restart
|
2010-01-12 15:48:48 +01:00
|
|
|
- RETVAL=$?
|
2011-05-31 14:57:59 +02:00
|
|
|
+ try-restart|condrestart)
|
|
|
|
+ if [ -e /var/run/rcebtables ]; then
|
|
|
|
+ restart
|
|
|
|
+ fi
|
2010-01-12 15:48:48 +01:00
|
|
|
;;
|
|
|
|
save)
|
|
|
|
save
|
2011-05-31 14:57:59 +02:00
|
|
|
+ rc_status -v
|
2010-01-12 15:48:48 +01:00
|
|
|
;;
|
|
|
|
status)
|
|
|
|
__EXEC_PATH__/ebtables-save
|
|
|
|
- RETVAL=$?
|
|
|
|
+ rc_status -v
|
|
|
|
;;
|
|
|
|
*)
|
2011-05-31 14:57:59 +02:00
|
|
|
- echo $"Usage $0 {start|stop|restart|condrestart|save|status}"
|
2010-01-12 15:48:48 +01:00
|
|
|
- RETVAL=1
|
2011-05-31 14:57:59 +02:00
|
|
|
+ echo $"Usage $0 {start|stop|restart|try-restart|save|status}"
|
2010-01-12 15:48:48 +01:00
|
|
|
+ exit 1
|
|
|
|
+ ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
-exit $RETVAL
|
|
|
|
+rc_exit
|