aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2021-08-13 16:13:39 +1200
committerTom Ryder <tom@sanctum.geek.nz>2021-08-13 16:13:39 +1200
commit5a3415fd9bdf8fbdd11c87223949075212b57f03 (patch)
tree4980b6afe00a760bf074a670a290c2517bbc0bb5
parentMerge branch 'release/v1.0.0' (diff)
downloadnscaw-5a3415fd9bdf8fbdd11c87223949075212b57f03.tar.gz
nscaw-5a3415fd9bdf8fbdd11c87223949075212b57f03.zip
Build and shebang nscaw from source file
-rw-r--r--.gitignore1
-rw-r--r--Makefile15
-rw-r--r--[-rwxr-xr-x]nscaw.bash (renamed from nscaw)2
3 files changed, 14 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b7c2666
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/nscaw
diff --git a/Makefile b/Makefile
index 9814ba5..3944539 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,16 @@
.POSIX:
-.PHONY: all install
+.PHONY: all install clean
.SUFFIXES:
+.SUFFIXES: .bash
+ALL = nscaw
+BASH = /bin/bash
PREFIX = /usr/local
-all:
-install:
+all: $(ALL)
+.bash:
+ $(BASH) -c :
+ awk -v interpreter=$(BASH) 'NR == 1 { $$1 ="#!" interpreter } 1' $< > $@
+ chmod +x ./$@
+install: nscaw
cp -- nscaw $(PREFIX)/bin
+clean:
+ rm -f -- $(ALL)
diff --git a/nscaw b/nscaw.bash
index de8364f..e5651d7 100755..100644
--- a/nscaw
+++ b/nscaw.bash
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!bash
#
# Command wrapper that sends an appropriate passive check to an NSCA server