summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2020-01-02 18:15:38 +0100
committerFlorian Pritz <bluewind@xinu.at>2020-01-02 18:20:04 +0100
commitd62b9a4467ca6d6067f8600b2759fbda296f9da7 (patch)
tree2fa21a5cdfc5a352669f9990a929cb959cd0ff58
parentd59a2a3d6cd9a7449e654cf6fbee9a14a44619e9 (diff)
downloadbin-d62b9a4467ca6d6067f8600b2759fbda296f9da7.tar.gz
bin-d62b9a4467ca6d6067f8600b2759fbda296f9da7.tar.xz
Add fwbuilder
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xfwbuilder19
1 files changed, 19 insertions, 0 deletions
diff --git a/fwbuilder b/fwbuilder
new file mode 100755
index 0000000..23edbf3
--- /dev/null
+++ b/fwbuilder
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Remove old compiled firewalls in case fwbuilder fails to compile. This
+# prevents it from redeploying old files by mistake.
+
+set -eu
+
+if [[ "$#" != 1 ]]; then
+ echo "Usage: fwbuilder <file>" >&2
+ exit 1
+fi
+
+file="$1"
+
+dir="$(dirname "$file")"
+shopt -s nullglob
+rm -f "$dir"/*.fw
+
+exec /usr/bin/fwbuilder "$file"