summaryrefslogtreecommitdiff
path: root/repo/iptables/use-sh-iptables-apply.patch
blob: b31fc948c4e183d4cb88f188d926e5e10e1d5fc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Simon Frankenberger <simon-alpine@fraho.eu>

make iptables-apply use posix sh

--- a/iptables/iptables-apply
+++ b/iptables/iptables-apply
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # iptables-apply -- a safer way to update iptables remotely
 #
 # Usage:
@@ -110,7 +110,7 @@
 }
 
 function checkcommands() {
-	for cmd in "${COMMANDS[@]}"; do
+	for cmd in ${COMMANDS}; do
 		if ! command -v "$cmd" >/dev/null; then
 			echo "Error: needed command not found: $cmd" >&2
 			exit 127
@@ -184,7 +184,7 @@
 		fi
 
 		# Needed commands
-		COMMANDS=(mktemp "$SAVE" "$RESTORE" "$RUNCMD")
+		COMMANDS="mktemp $SAVE $RESTORE $RUNCMD"
 		checkcommands
 		;;
 	(*)
@@ -196,7 +196,7 @@
 		fi
 
 		# Needed commands
-		COMMANDS=(mktemp "$SAVE" "$RESTORE")
+		COMMANDS="mktemp $SAVE $RESTORE"
 		checkcommands
 		;;
 esac