Blame SOURCES/0016-arptables-cleanup-sysvinit-script.patch

0890d3
From 6e39026e78c20319d1f5006bbe6ad0f7541d58ae Mon Sep 17 00:00:00 2001
0890d3
From: Arturo Borrero Gonzalez <arturo@netfilter.org>
0890d3
Date: Thu, 3 May 2018 11:28:31 +0200
0890d3
Subject: [PATCH] arptables: cleanup sysvinit script
0890d3
0890d3
This file belong to downstream distributions. Also, it's unmaintained.
0890d3
0890d3
Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
0890d3
(cherry picked from commit 988d6a4cd1b12718177bf3065f07faeabb208713)
0890d3
Signed-off-by: Phil Sutter <psutter@redhat.com>
0890d3
---
0890d3
 Makefile       |   8 +---
0890d3
 arptables.sysv | 103 -------------------------------------------------
0890d3
 2 files changed, 2 insertions(+), 109 deletions(-)
0890d3
 delete mode 100644 arptables.sysv
0890d3
0890d3
diff --git a/Makefile b/Makefile
0890d3
index 7bead0d9134f3..139c9cae9ff6c 100644
0890d3
--- a/Makefile
0890d3
+++ b/Makefile
0890d3
@@ -7,7 +7,6 @@ LIBDIR:=$(PREFIX)/lib
0890d3
 BINDIR:=$(PREFIX)/sbin
0890d3
 MANDIR:=$(PREFIX)/man
0890d3
 man8dir=$(MANDIR)/man8
0890d3
-INITDIR:=/etc/rc.d/init.d
0890d3
 SYSCONFIGDIR:=/etc/sysconfig
0890d3
 DESTDIR:=
0890d3
 
0890d3
@@ -46,15 +45,12 @@ $(DESTDIR)$(BINDIR)/arptables: arptables
0890d3
 tmp1:=$(shell printf $(BINDIR) | sed 's/\//\\\//g')
0890d3
 tmp2:=$(shell printf $(SYSCONFIGDIR) | sed 's/\//\\\//g')
0890d3
 .PHONY: scripts
0890d3
-scripts: arptables-save arptables-restore arptables.sysv
0890d3
+scripts: arptables-save arptables-restore
0890d3
 	cat arptables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > arptables-save_
0890d3
 	install -m 0755 arptables-save_ $(DESTDIR)$(BINDIR)/arptables-save
0890d3
 	cat arptables-restore | sed 's/__EXEC_PATH__/$(tmp1)/g' > arptables-restore_
0890d3
 	install -m 0755 arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-restore
0890d3
-	cat arptables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > arptables.sysv_
0890d3
-	if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi
0890d3
-	if test -d $(DESTDIR)$(INITDIR); then install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi
0890d3
-	rm -f arptables-save_ arptables-restore_ arptables.sysv_
0890d3
+	rm -f arptables-save_ arptables-restore_
0890d3
 
0890d3
 .PHONY: install-man
0890d3
 install-man: $(MANS)
0890d3
diff --git a/arptables.sysv b/arptables.sysv
0890d3
deleted file mode 100644
0890d3
index ea5cf092ef2c8..0000000000000
0890d3
--- a/arptables.sysv
0890d3
+++ /dev/null
0890d3
@@ -1,103 +0,0 @@
0890d3
-#!/bin/bash
0890d3
-#
0890d3
-# init script for arptables
0890d3
-#
0890d3
-# Original by Dag Wieers <dag@wieers.com>.
0890d3
-# Modified/changed to arptables by
0890d3
-# 	Rok Papez <rok.papez@arnes.si>.
0890d3
-#
0890d3
-# chkconfig: - 16 84
0890d3
-# description: Arp filtering tables
0890d3
-#
0890d3
-# config: __SYSCONFIG__/arptables
0890d3
-
0890d3
-source /etc/init.d/functions
0890d3
-source /etc/sysconfig/network
0890d3
-
0890d3
-# Check that networking is up.
0890d3
-[ ${NETWORKING} = "no" ] && exit 0
0890d3
-
0890d3
-[ -x __EXEC_PATH__/arptables ] || exit 1
0890d3
-[ -x __EXEC_PATH__/arptables-save ] || exit 1
0890d3
-[ -x __EXEC_PATH__/arptables-restore ] || exit 1
0890d3
-
0890d3
-[ "$1" != "save" -o -r __SYSCONFIG__/arptables ] || exit 1
0890d3
-
0890d3
-RETVAL=0
0890d3
-prog="arptables"
0890d3
-desc="Arp filtering"
0890d3
-
0890d3
-start() {
0890d3
-	echo -n $"Starting $desc ($prog): "
0890d3
-	__EXEC_PATH__/arptables-restore < __SYSCONFIG__/arptables || RETVAL=1
0890d3
-
0890d3
-	if [ $RETVAL -eq 0 ]; then
0890d3
-		success "$prog startup"
0890d3
-		rm -f /var/lock/subsys/$prog
0890d3
-	else
0890d3
-		failure "$prog startup"
0890d3
-	fi
0890d3
-
0890d3
-	echo
0890d3
-	return $RETVAL
0890d3
-}
0890d3
-
0890d3
-stop() {
0890d3
-	echo -n $"Stopping $desc ($prog): "
0890d3
-	__EXEC_PATH__/arptables-restore < /dev/null || RETVAL=1
0890d3
-
0890d3
-	if [ $RETVAL -eq 0 ]; then
0890d3
-		success "$prog shutdown"
0890d3
-		rm -f %{_localstatedir}/lock/subsys/$prog
0890d3
-	else
0890d3
-		failure "$prog shutdown"
0890d3
-	fi
0890d3
-
0890d3
-	echo
0890d3
-	return $RETVAL
0890d3
-}
0890d3
-
0890d3
-restart() {
0890d3
-	stop
0890d3
-	start
0890d3
-}
0890d3
-
0890d3
-save() {
0890d3
-	echo -n $"Saving $desc ($prog): "
0890d3
-	__EXEC_PATH__/arptables-save > __SYSCONFIG__/arptables || RETVAL=1
0890d3
-
0890d3
-	if [ $RETVAL -eq 0 ]; then
0890d3
-		success "$prog saved"
0890d3
-	else
0890d3
-		failure "$prog saved"
0890d3
-	fi
0890d3
-	echo
0890d3
-}
0890d3
-
0890d3
-case "$1" in
0890d3
-  start)
0890d3
-	start
0890d3
-	;;
0890d3
-  stop)
0890d3
-	stop
0890d3
-	;;
0890d3
-  restart|reload)
0890d3
-	restart
0890d3
-	;;
0890d3
-  condrestart)
0890d3
-	[ -e /var/lock/subsys/$prog ] && restart
0890d3
-	RETVAL=$?
0890d3
-	;;
0890d3
-  save)
0890d3
-	save
0890d3
-	;;
0890d3
-  status)
0890d3
-	__EXEC_PATH__/arptables-save
0890d3
-	RETVAL=$?
0890d3
-	;;
0890d3
-  *)
0890d3
-	echo $"Usage $0 {start|stop|restart|condrestart|save|status}"
0890d3
-	RETVAL=1
0890d3
-esac
0890d3
-
0890d3
-exit $RETVAL
0890d3
-- 
0890d3
2.21.0
0890d3