|
|
05e71a |
From 2fab90f7b61fdd433b81b66a60a0124154231486 Mon Sep 17 00:00:00 2001
|
|
|
05e71a |
From: Arturo Borrero Gonzalez <arturo@netfilter.org>
|
|
|
05e71a |
Date: Tue, 22 Jan 2019 18:41:52 +0100
|
|
|
05e71a |
Subject: [PATCH] ebtables: drop sysvinit script
|
|
|
05e71a |
|
|
|
05e71a |
This configuration file belongs to downstream distributions.
|
|
|
05e71a |
Also, it's unmaintained.
|
|
|
05e71a |
|
|
|
05e71a |
Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
|
|
|
05e71a |
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
05e71a |
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
|
05e71a |
---
|
|
|
05e71a |
.gitignore | 1 -
|
|
|
05e71a |
Makefile.am | 5 +-
|
|
|
05e71a |
ebtables.sysv.in | 145 -----------------------------------------------
|
|
|
05e71a |
3 files changed, 1 insertion(+), 150 deletions(-)
|
|
|
05e71a |
delete mode 100644 ebtables.sysv.in
|
|
|
05e71a |
|
|
|
05e71a |
diff --git a/.gitignore b/.gitignore
|
|
|
05e71a |
index 1fff83c78ba13..c1fae5463a355 100644
|
|
|
05e71a |
--- a/.gitignore
|
|
|
05e71a |
+++ b/.gitignore
|
|
|
05e71a |
@@ -22,7 +22,6 @@ Makefile.in
|
|
|
05e71a |
/ebtables-restore
|
|
|
05e71a |
/ebtables-save
|
|
|
05e71a |
/ebtables.8
|
|
|
05e71a |
-/ebtables.sysv
|
|
|
05e71a |
/ebtablesd
|
|
|
05e71a |
/ebtablesu
|
|
|
05e71a |
/static
|
|
|
05e71a |
diff --git a/Makefile.am b/Makefile.am
|
|
|
05e71a |
index b16a4d6dba269..59ae595ee16de 100644
|
|
|
05e71a |
--- a/Makefile.am
|
|
|
05e71a |
+++ b/Makefile.am
|
|
|
05e71a |
@@ -60,14 +60,11 @@ examples_ulog_test_ulog_SOURCES = examples/ulog/test_ulog.c getethertype.c
|
|
|
05e71a |
daemon: ebtablesd ebtablesu
|
|
|
05e71a |
exec: ebtables-legacy ebtables-legacy-restore
|
|
|
05e71a |
|
|
|
05e71a |
-CLEANFILES = ebtables-legacy-save ebtables.sysv ebtables-config ebtables-legacy.8
|
|
|
05e71a |
+CLEANFILES = ebtables-legacy-save ebtables-config ebtables-legacy.8
|
|
|
05e71a |
|
|
|
05e71a |
ebtables-legacy-save: ebtables-save.in ${top_builddir}/config.status
|
|
|
05e71a |
${AM_V_GEN}sed -e 's![@]sbindir@!${sbindir}!g' <$< >$@
|
|
|
05e71a |
|
|
|
05e71a |
-ebtables.sysv: ebtables.sysv.in ${top_builddir}/config.status
|
|
|
05e71a |
- ${AM_V_GEN}sed -e 's![@]sbindir@!${sbindir}!g' -e 's![@]sysconfigdir@!${sysconfigdir}!g' <$< >$@
|
|
|
05e71a |
-
|
|
|
05e71a |
ebtables-config: ebtables-config.in ${top_builddir}/config.status
|
|
|
05e71a |
${AM_V_GEN}sed -e 's![@]sysconfigdir@!${sysconfigdir}!g' <$< >$@
|
|
|
05e71a |
|
|
|
05e71a |
diff --git a/ebtables.sysv.in b/ebtables.sysv.in
|
|
|
05e71a |
deleted file mode 100644
|
|
|
05e71a |
index bbf0e7424cb2b..0000000000000
|
|
|
05e71a |
--- a/ebtables.sysv.in
|
|
|
05e71a |
+++ /dev/null
|
|
|
05e71a |
@@ -1,145 +0,0 @@
|
|
|
05e71a |
-#!/bin/bash
|
|
|
05e71a |
-#
|
|
|
05e71a |
-# init script for the Ethernet Bridge filter tables
|
|
|
05e71a |
-#
|
|
|
05e71a |
-# Written by Dag Wieers <dag@wieers.com>
|
|
|
05e71a |
-# Modified by Rok Papez <rok.papez@arnes.si>
|
|
|
05e71a |
-# Bart De Schuymer <bdschuym@pandora.be>
|
|
|
05e71a |
-#
|
|
|
05e71a |
-# chkconfig: - 15 85
|
|
|
05e71a |
-# description: Ethernet Bridge filtering tables
|
|
|
05e71a |
-#
|
|
|
05e71a |
-# config: @sysconfigdir@/ebtables (text)
|
|
|
05e71a |
-# @sysconfigdir@/ebtables. (binary)
|
|
|
05e71a |
-
|
|
|
05e71a |
-source /etc/init.d/functions
|
|
|
05e71a |
-source /etc/sysconfig/network
|
|
|
05e71a |
-
|
|
|
05e71a |
-# Check that networking is up.
|
|
|
05e71a |
-[ ${NETWORKING} = "no" ] && exit 0
|
|
|
05e71a |
-
|
|
|
05e71a |
-[ -x @sbindir@/ebtables ] || exit 1
|
|
|
05e71a |
-[ -x @sbindir@/ebtables-save ] || exit 1
|
|
|
05e71a |
-[ -x @sbindir@/ebtables-restore ] || exit 1
|
|
|
05e71a |
-
|
|
|
05e71a |
-RETVAL=0
|
|
|
05e71a |
-prog="ebtables"
|
|
|
05e71a |
-desc="Ethernet bridge filtering"
|
|
|
05e71a |
-umask 0077
|
|
|
05e71a |
-
|
|
|
05e71a |
-#default configuration
|
|
|
05e71a |
-EBTABLES_TEXT_FORMAT="yes"
|
|
|
05e71a |
-EBTABLES_BINARY_FORMAT="yes"
|
|
|
05e71a |
-EBTABLES_MODULES_UNLOAD="yes"
|
|
|
05e71a |
-EBTABLES_SAVE_ON_STOP="no"
|
|
|
05e71a |
-EBTABLES_SAVE_ON_RESTART="no"
|
|
|
05e71a |
-EBTABLES_SAVE_COUNTER="no"
|
|
|
05e71a |
-
|
|
|
05e71a |
-config=@sysconfigdir@/$prog-config
|
|
|
05e71a |
-[ -f "$config" ] && . "$config"
|
|
|
05e71a |
-
|
|
|
05e71a |
-start() {
|
|
|
05e71a |
- echo -n $"Starting $desc ($prog): "
|
|
|
05e71a |
- if [ "$EBTABLES_BINARY_FORMAT" = "yes" ]; then
|
|
|
05e71a |
- for table in $(ls @sysconfigdir@/ebtables.* 2>/dev/null | sed -e 's/.*ebtables\.//' -e '/save/d' ); do
|
|
|
05e71a |
- @sbindir@/ebtables -t $table --atomic-file @sysconfigdir@/ebtables.$table --atomic-commit || RETVAL=1
|
|
|
05e71a |
- done
|
|
|
05e71a |
- else
|
|
|
05e71a |
- @sbindir@/ebtables-restore < /etc/sysconfig/ebtables || RETVAL=1
|
|
|
05e71a |
- fi
|
|
|
05e71a |
-
|
|
|
05e71a |
- if [ $RETVAL -eq 0 ]; then
|
|
|
05e71a |
- success "$prog startup"
|
|
|
05e71a |
- rm -f /var/lock/subsys/$prog
|
|
|
05e71a |
- else
|
|
|
05e71a |
- failure "$prog startup"
|
|
|
05e71a |
- fi
|
|
|
05e71a |
- echo
|
|
|
05e71a |
-}
|
|
|
05e71a |
-
|
|
|
05e71a |
-stop() {
|
|
|
05e71a |
- echo -n $"Stopping $desc ($prog): "
|
|
|
05e71a |
- for table in $(grep '^ebtable_' /proc/modules | sed -e 's/ebtable_\([^ ]*\).*/\1/'); do
|
|
|
05e71a |
- @sbindir@/ebtables -t $table --init-table || RETVAL=1
|
|
|
05e71a |
- done
|
|
|
05e71a |
-
|
|
|
05e71a |
- if [ "$EBTABLES_MODULES_UNLOAD" = "yes" ]; then
|
|
|
05e71a |
- for mod in $(grep -E '^(ebt|ebtable)_' /proc/modules | cut -f1 -d' ') ebtables; do
|
|
|
05e71a |
- rmmod $mod 2> /dev/null
|
|
|
05e71a |
- done
|
|
|
05e71a |
- fi
|
|
|
05e71a |
-
|
|
|
05e71a |
- if [ $RETVAL -eq 0 ]; then
|
|
|
05e71a |
- success "$prog shutdown"
|
|
|
05e71a |
- rm -f /var/lock/subsys/$prog
|
|
|
05e71a |
- else
|
|
|
05e71a |
- failure "$prog shutdown"
|
|
|
05e71a |
- fi
|
|
|
05e71a |
- echo
|
|
|
05e71a |
-}
|
|
|
05e71a |
-
|
|
|
05e71a |
-restart() {
|
|
|
05e71a |
- stop
|
|
|
05e71a |
- start
|
|
|
05e71a |
-}
|
|
|
05e71a |
-
|
|
|
05e71a |
-save() {
|
|
|
05e71a |
- echo -n $"Saving $desc ($prog): "
|
|
|
05e71a |
- if [ "$EBTABLES_TEXT_FORMAT" = "yes" ]; then
|
|
|
05e71a |
- if [ -e @sysconfigdir@/ebtables ]; then
|
|
|
05e71a |
- chmod 0600 @sysconfigdir@/ebtables
|
|
|
05e71a |
- mv -f @sysconfigdir@/ebtables @sysconfigdir@/ebtables.save
|
|
|
05e71a |
- fi
|
|
|
05e71a |
- @sbindir@/ebtables-save > @sysconfigdir@/ebtables || RETVAL=1
|
|
|
05e71a |
- fi
|
|
|
05e71a |
- if [ "$EBTABLES_BINARY_FORMAT" = "yes" ]; then
|
|
|
05e71a |
- rm -f @sysconfigdir@/ebtables.*.save
|
|
|
05e71a |
- for oldtable in $(ls @sysconfigdir@/ebtables.* 2>/dev/null | grep -vF 'ebtables.save'); do
|
|
|
05e71a |
- chmod 0600 $oldtable
|
|
|
05e71a |
- mv -f $oldtable $oldtable.save
|
|
|
05e71a |
- done
|
|
|
05e71a |
- for table in $(grep '^ebtable_' /proc/modules | sed -e 's/ebtable_\([^ ]*\).*/\1/'); do
|
|
|
05e71a |
- @sbindir@/ebtables -t $table --atomic-file @sysconfigdir@/ebtables.$table --atomic-save || RETVAL=1
|
|
|
05e71a |
- if [ "$EBTABLES_SAVE_COUNTER" = "no" ]; then
|
|
|
05e71a |
- @sbindir@/ebtables -t $table --atomic-file @sysconfigdir@/ebtables.$table -Z || RETVAL=1
|
|
|
05e71a |
- fi
|
|
|
05e71a |
- done
|
|
|
05e71a |
- fi
|
|
|
05e71a |
-
|
|
|
05e71a |
- if [ $RETVAL -eq 0 ]; then
|
|
|
05e71a |
- success "$prog saved"
|
|
|
05e71a |
- else
|
|
|
05e71a |
- failure "$prog saved"
|
|
|
05e71a |
- fi
|
|
|
05e71a |
- echo
|
|
|
05e71a |
-}
|
|
|
05e71a |
-
|
|
|
05e71a |
-case "$1" in
|
|
|
05e71a |
- start)
|
|
|
05e71a |
- start
|
|
|
05e71a |
- ;;
|
|
|
05e71a |
- stop)
|
|
|
05e71a |
- [ "$EBTABLES_SAVE_ON_STOP" = "yes" ] && save
|
|
|
05e71a |
- stop
|
|
|
05e71a |
- ;;
|
|
|
05e71a |
- restart|reload)
|
|
|
05e71a |
- [ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save
|
|
|
05e71a |
- restart
|
|
|
05e71a |
- ;;
|
|
|
05e71a |
- condrestart)
|
|
|
05e71a |
- [ -e /var/lock/subsys/$prog ] && restart
|
|
|
05e71a |
- RETVAL=$?
|
|
|
05e71a |
- ;;
|
|
|
05e71a |
- save)
|
|
|
05e71a |
- save
|
|
|
05e71a |
- ;;
|
|
|
05e71a |
- status)
|
|
|
05e71a |
- @sbindir@/ebtables-save
|
|
|
05e71a |
- RETVAL=$?
|
|
|
05e71a |
- ;;
|
|
|
05e71a |
- *)
|
|
|
05e71a |
- echo $"Usage $0 {start|stop|restart|condrestart|save|status}"
|
|
|
05e71a |
- RETVAL=1
|
|
|
05e71a |
-esac
|
|
|
05e71a |
-
|
|
|
05e71a |
-exit $RETVAL
|
|
|
05e71a |
--
|
|
|
05e71a |
2.21.0
|
|
|
05e71a |
|