summaryrefslogtreecommitdiff
path: root/data.d/vpn-wireguard/hooks/post-up
diff options
context:
space:
mode:
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