From 45f07b6392cfba92912e7488749523b91c764f4f Mon Sep 17 00:00:00 2001
From: sinanmohd <sinan@sinanmohd.com>
Date: Sat, 3 Feb 2024 13:57:45 +0530
Subject: kay/dns: fix race condition in ddns

---
 hosts/kay/modules/dns/ddns.nix | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'hosts/kay/modules/dns')

diff --git a/hosts/kay/modules/dns/ddns.nix b/hosts/kay/modules/dns/ddns.nix
index 5b87968..6d0a944 100644
--- a/hosts/kay/modules/dns/ddns.nix
+++ b/hosts/kay/modules/dns/ddns.nix
@@ -22,7 +22,9 @@
          type = "ipv6-up";
 
          text = ''
-            ipv6="$(ip -6 addr show dev $1 scope global | grep -o '[0-9a-f:]*::1')"
+            while ! ipv6="$(ip -6 addr show dev "$1" scope global | grep -o '[0-9a-f:]*::1')"; do
+               sleep 0.2
+            done
 
             cat <<- EOF | knsupdate
                     server  2001:470:ee65::1
-- 
cgit v1.2.3