ebtables/ebtables-v2.0.8-initscript.diff

115 lines
2.2 KiB
Diff
Raw Normal View History

Index: ebtables.sysv
===================================================================
--- ebtables.sysv.orig
+++ ebtables.sysv
@@ -11,12 +11,15 @@
#
# config: __SYSCONFIG__/ebtables (text)
# __SYSCONFIG__/ebtables.<table> (binary)
-
-source /etc/init.d/functions
-source /etc/sysconfig/network
-
-# Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 0
+### BEGIN INIT INFO
+# Provides: eptables
+# Required-Start: $remote_fs $network
+# Required-Stop: $remote_fs $network
+# Short-Description: Ethernet Bridge filter tables
+# Description: Ethernet Bridge filter tables
+# Default-Start: 2 3 5
+# Default-Stop: 0 1 6
+### END INIT INFO
[ -x __EXEC_PATH__/ebtables ] || exit 1
[ -x __EXEC_PATH__/ebtables-save ] || exit 1
@@ -35,8 +38,8 @@ EBTABLES_SAVE_ON_STOP="no"
EBTABLES_SAVE_ON_RESTART="no"
EBTABLES_SAVE_COUNTER="no"
-config=__SYSCONFIG__/$prog-config
-[ -f "$config" ] && . "$config"
+. /etc/rc.status
+rc_reset
start() {
echo -n $"Starting $desc ($prog): "
@@ -49,10 +52,10 @@ start() {
fi
if [ $RETVAL -eq 0 ]; then
- success "$prog startup"
+ rc_status -v
rm -f /var/lock/subsys/$prog
else
- failure "$prog startup"
+ rc_failed 3
fi
echo
}
@@ -70,10 +73,10 @@ stop() {
fi
if [ $RETVAL -eq 0 ]; then
- success "$prog shutdown"
+ rc_status -v
rm -f /var/lock/subsys/$prog
else
- failure "$prog shutdown"
+ rc_failed 3
fi
echo
}
@@ -107,9 +110,9 @@ save() {
fi
if [ $RETVAL -eq 0 ]; then
- success "$prog saved"
+ rc_status -v
else
- failure "$prog saved"
+ rc_failed 3
fi
echo
}
@@ -117,29 +120,34 @@ save() {
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
+ rc_status -v
;;
condrestart)
[ -e /var/lock/subsys/$prog ] && restart
- RETVAL=$?
+ rc_status
;;
save)
save
+ rc_status
;;
status)
__EXEC_PATH__/ebtables-save
- RETVAL=$?
+ rc_status -v
;;
*)
echo $"Usage $0 {start|stop|restart|condrestart|save|status}"
- RETVAL=1
+ exit 1
+ ;;
esac
-exit $RETVAL
+rc_exit