summaryrefslogtreecommitdiff
path: root/data.d/vpn-wireguard/hooks/post-up
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2024-01-05 12:10:17 +0100
committerPatrick Spek <p.spek@tyil.nl>2024-01-05 12:10:17 +0100
commit76ec6dd2c3a56fac5f09943a9f7af9f4e2d17682 (patch)
tree2bd72013c7cb8215f804514152e98e922fcd6083 /data.d/vpn-wireguard/hooks/post-up
parentdad6d287dbb30f0984bfab7be9b489e27dcfefc5 (diff)
Update vpn-wireguard playbook
Diffstat (limited to 'data.d/vpn-wireguard/hooks/post-up')
-rwxr-xr-xdata.d/vpn-wireguard/hooks/post-up10
1 files changed, 10 insertions, 0 deletions
diff --git a/data.d/vpn-wireguard/hooks/post-up b/data.d/vpn-wireguard/hooks/post-up
new file mode 100755
index 0000000..948a9a8
--- /dev/null
+++ b/data.d/vpn-wireguard/hooks/post-up
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+# Ping all known hosts, as it seems that the wireguard interface comes up when
+# only after it gets used on the machine itself.
+while read -r addr;
+do
+ ping -c 1 -q -w 1 "$addr" &
+done < <(awk -F= '/vpn-wireguard.ip/ { print $NF }' /etc/bashtard/hosts.d/*)
+
+wait