From b0b40248b4d229c78b760ac6affe304a8ed49bd9 Mon Sep 17 00:00:00 2001 From: Timothy Allen Date: Fri, 18 Jul 2025 11:12:43 +0200 Subject: [PATCH] Avoid bash expanding local files in grep arguments --- update_ip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update_ip.sh b/update_ip.sh index 9a742e0..fe21634 100755 --- a/update_ip.sh +++ b/update_ip.sh @@ -12,7 +12,7 @@ zone=dyn.example.com host=desktop secret="" -server_ip=$( dig +short ${server} | grep [0-9] | head -1 ) +server_ip=$( dig +short ${server} | grep "[0-9]" | head -1 ) iface=$( ip route get ${server_ip} | grep -Po '(?<=(dev ))(\S+)' ) # TODO trigger not via cron, but using ip monitor in a while/sleep loop: