Blob Blame History Raw
From 6e39026e78c20319d1f5006bbe6ad0f7541d58ae Mon Sep 17 00:00:00 2001
From: Arturo Borrero Gonzalez <arturo@netfilter.org>
Date: Thu, 3 May 2018 11:28:31 +0200
Subject: [PATCH] arptables: cleanup sysvinit script

This file belong to downstream distributions. Also, it's unmaintained.

Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
(cherry picked from commit 988d6a4cd1b12718177bf3065f07faeabb208713)
Signed-off-by: Phil Sutter <psutter@redhat.com>
---
 Makefile       |   8 +---
 arptables.sysv | 103 -------------------------------------------------
 2 files changed, 2 insertions(+), 109 deletions(-)
 delete mode 100644 arptables.sysv

diff --git a/Makefile b/Makefile
index 7bead0d9134f3..139c9cae9ff6c 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,6 @@ LIBDIR:=$(PREFIX)/lib
 BINDIR:=$(PREFIX)/sbin
 MANDIR:=$(PREFIX)/man
 man8dir=$(MANDIR)/man8
-INITDIR:=/etc/rc.d/init.d
 SYSCONFIGDIR:=/etc/sysconfig
 DESTDIR:=
 
@@ -46,15 +45,12 @@ $(DESTDIR)$(BINDIR)/arptables: arptables
 tmp1:=$(shell printf $(BINDIR) | sed 's/\//\\\//g')
 tmp2:=$(shell printf $(SYSCONFIGDIR) | sed 's/\//\\\//g')
 .PHONY: scripts
-scripts: arptables-save arptables-restore arptables.sysv
+scripts: arptables-save arptables-restore
 	cat arptables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > arptables-save_
 	install -m 0755 arptables-save_ $(DESTDIR)$(BINDIR)/arptables-save
 	cat arptables-restore | sed 's/__EXEC_PATH__/$(tmp1)/g' > arptables-restore_
 	install -m 0755 arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-restore
-	cat arptables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > arptables.sysv_
-	if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi
-	if test -d $(DESTDIR)$(INITDIR); then install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi
-	rm -f arptables-save_ arptables-restore_ arptables.sysv_
+	rm -f arptables-save_ arptables-restore_
 
 .PHONY: install-man
 install-man: $(MANS)
diff --git a/arptables.sysv b/arptables.sysv
deleted file mode 100644
index ea5cf092ef2c8..0000000000000
--- a/arptables.sysv
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/bash
-#
-# init script for arptables
-#
-# Original by Dag Wieers <dag@wieers.com>.
-# Modified/changed to arptables by
-# 	Rok Papez <rok.papez@arnes.si>.
-#
-# chkconfig: - 16 84
-# description: Arp filtering tables
-#
-# config: __SYSCONFIG__/arptables
-
-source /etc/init.d/functions
-source /etc/sysconfig/network
-
-# Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 0
-
-[ -x __EXEC_PATH__/arptables ] || exit 1
-[ -x __EXEC_PATH__/arptables-save ] || exit 1
-[ -x __EXEC_PATH__/arptables-restore ] || exit 1
-
-[ "$1" != "save" -o -r __SYSCONFIG__/arptables ] || exit 1
-
-RETVAL=0
-prog="arptables"
-desc="Arp filtering"
-
-start() {
-	echo -n $"Starting $desc ($prog): "
-	__EXEC_PATH__/arptables-restore < __SYSCONFIG__/arptables || RETVAL=1
-
-	if [ $RETVAL -eq 0 ]; then
-		success "$prog startup"
-		rm -f /var/lock/subsys/$prog
-	else
-		failure "$prog startup"
-	fi
-
-	echo
-	return $RETVAL
-}
-
-stop() {
-	echo -n $"Stopping $desc ($prog): "
-	__EXEC_PATH__/arptables-restore < /dev/null || RETVAL=1
-
-	if [ $RETVAL -eq 0 ]; then
-		success "$prog shutdown"
-		rm -f %{_localstatedir}/lock/subsys/$prog
-	else
-		failure "$prog shutdown"
-	fi
-
-	echo
-	return $RETVAL
-}
-
-restart() {
-	stop
-	start
-}
-
-save() {
-	echo -n $"Saving $desc ($prog): "
-	__EXEC_PATH__/arptables-save > __SYSCONFIG__/arptables || RETVAL=1
-
-	if [ $RETVAL -eq 0 ]; then
-		success "$prog saved"
-	else
-		failure "$prog saved"
-	fi
-	echo
-}
-
-case "$1" in
-  start)
-	start
-	;;
-  stop)
-	stop
-	;;
-  restart|reload)
-	restart
-	;;
-  condrestart)
-	[ -e /var/lock/subsys/$prog ] && restart
-	RETVAL=$?
-	;;
-  save)
-	save
-	;;
-  status)
-	__EXEC_PATH__/arptables-save
-	RETVAL=$?
-	;;
-  *)
-	echo $"Usage $0 {start|stop|restart|condrestart|save|status}"
-	RETVAL=1
-esac
-
-exit $RETVAL
-- 
2.21.0