From dcb3d7436bf400b17b5091812b6b8cb73c91d20c Mon Sep 17 00:00:00 2001 From: Eduard Veit Date: Thu, 26 May 2022 13:30:23 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20curl/libcurl=20doesn't=20?= =?UTF-8?q?support=20dns-server=20option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the latest alpine we are using for the docker image does also drops the support for that option like debian/ubuntu/etc --- dynb.sh | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/dynb.sh b/dynb.sh index d78ae5d..6d87c61 100755 --- a/dynb.sh +++ b/dynb.sh @@ -66,7 +66,7 @@ _response= _statusHostname= _statusUsername= _statusPassword= -_version=0.3.0 +_version=0.3.1 _userAgent="DynB/$_version github.com/EV21/dynb" _configFile=$HOME/.local/share/dynb/.env _statusFile=/tmp/dynb.status @@ -209,17 +209,12 @@ function getRemoteIP { local ip_version=$1 local ip_check_server=$2 - if [[ -n $_DNS_checkServer ]] - then - curl --silent "$_interface_str" --user-agent "$_userAgent" \ - --ipv"${ip_version}" --dns-servers "$_DNS_checkServer" --location "${ip_check_server}" - else - curl --silent "$_interface_str" --user-agent "$_userAgent" \ - --ipv"${ip_version}" --location "${ip_check_server}" - fi + curl --silent "$_interface_str" --user-agent "$_userAgent" \ + --ipv"${ip_version}" --location "${ip_check_server}" + local curls_status_code=$? # shellcheck disable=2181 - if [[ $? -gt 0 ]]; then - errorMessage "IPCheck (getRemoteIP ${1}) request failed" + if [[ $curls_status_code -gt 0 ]]; then + errorMessage "IPCheck (getRemoteIP $ip_version) request failed" exit 1 fi }