summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-10-10 20:15:01 +0200
committerErich Eckner <git@eckner.net>2020-10-10 20:15:01 +0200
commit1ca52ae8519aadb8ba42f4a7af2b0f13ac6e01ff (patch)
tree5884f1a16d8a26fd5770aa46c632aa5127412551
parentfb789e7d52cc67d3f5a3e713a355e121e772ebcb (diff)
downloadreboot-if-no-net-connection-1ca52ae8519aadb8ba42f4a7af2b0f13ac6e01ff.tar.xz
Makefile neu
-rw-r--r--.gitignore1
-rw-r--r--Makefile19
-rwxr-xr-xreboot-if-no-net-connection.in (renamed from reboot-if-no-net-connection)2
3 files changed, 22 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e2586d5
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+reboot-if-no-net-connection
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..482c429
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,19 @@
+DESTDIR =
+BINDIR = /usr/bin
+LIBDIR = /usr/lib
+
+VERSION = 0.0
+
+all: reboot-if-no-net-connection
+
+%: %.in
+ sed " \
+ s/#VERSION#/$(VERSION)/; \
+ " $< > $@
+ [ "$@" = "reboot-if-no-net-connection" ] && chmod +x "$@" || true
+
+.PHONY: install
+
+install: all
+ install -D -m0755 -t $(DESTDIR)$(BINDIR) reboot-if-no-net-connection
+ install -D -m0644 -t $(DESTDIR)$(LIBDIR)/systemd/system reboot-if-no-net-connection.service reboot-if-no-net-connection.timer
diff --git a/reboot-if-no-net-connection b/reboot-if-no-net-connection.in
index bb8c43d..b1d41fb 100755
--- a/reboot-if-no-net-connection
+++ b/reboot-if-no-net-connection.in
@@ -1,5 +1,7 @@
#!/bin/bash
+# Version #VERSION#
+
for i in {1..300}; do
default_gateway=$(