From c590161380c7ef429bd9f185da2fb6787913efc7 Mon Sep 17 00:00:00 2001 From: IgorKha Date: Wed, 23 Aug 2023 00:52:17 +0500 Subject: [PATCH] Fixes #5: The command 'dig' has been replaced with the built-in 'host' --- wireguard-mikrotik.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wireguard-mikrotik.sh b/wireguard-mikrotik.sh index 10da412..b1bf8c8 100755 --- a/wireguard-mikrotik.sh +++ b/wireguard-mikrotik.sh @@ -101,7 +101,7 @@ function installQuestions() { echo "" # Detect public IPv4 or IPv6 address and pre-fill for the user - SERVER_PUB_IP=$(dig +short myip.opendns.com @resolver1.opendns.com) + SERVER_PUB_IP=$(host myip.opendns.com resolver1.opendns.com | grep -oP 'has address \K[0-9.]+') if [[ -z ${SERVER_PUB_IP} ]]; then # Detect public IPv6 address SERVER_PUB_IP=$(ip -6 addr | sed -ne 's|^.* inet6 \([^/]*\)/.* scope global.*$|\1|p' | head -1)