summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rwxr-xr-xdhcpcd/80-pacredir11
2 files changed, 12 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f41b033..ffba1c3 100644
--- a/Makefile
+++ b/Makefile
@@ -45,6 +45,7 @@ install-bin: pacredir
$(INSTALL) -D -m0644 systemd/pacserve.service $(DESTDIR)/usr/lib/systemd/system/pacserve.service
$(INSTALL) -D -m0644 systemd/pacdbserve.service $(DESTDIR)/usr/lib/systemd/system/pacdbserve.service
$(INSTALL) -D -m0644 systemd/pacredir.service $(DESTDIR)/usr/lib/systemd/system/pacredir.service
+ $(INSTALL) -D -m0755 dhcpcd/80-pacredir $(DESTDIR)/usr/lib/dhcpcd/dhcpcd-hooks/80-pacredir
install-doc: README.html
$(INSTALL) -D -m0644 README.md $(DESTDIR)/usr/share/doc/paccache/README.md
diff --git a/dhcpcd/80-pacredir b/dhcpcd/80-pacredir
new file mode 100755
index 0000000..50bed5c
--- /dev/null
+++ b/dhcpcd/80-pacredir
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+case "${reason}" in
+ BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC)
+ # inform pacredir about reestablished connection
+ kill -HUP $(pgrep pacredir)
+ ;;
+ PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP)
+ # do nothing here...
+ ;;
+esac