From dc0953fedd19cf77e76e0198457ab2f1a24b1572 Mon Sep 17 00:00:00 2001 From: Claudio Marelli Date: Sat, 15 Jan 2022 10:07:30 +0100 Subject: ddns-scripts: pass user agent string This adds a user agent string to the wget request. Fixes #17507 Signed-off-by: Claudio Marelli --- net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'net/ddns-scripts/files/usr/lib/ddns') diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh index f36d11ca7..cb345e846 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh @@ -745,6 +745,13 @@ do_transfer() { # disable proxy if no set (there might be .wgetrc or .curlrc or wrong environment set) [ -z "$proxy" ] && __PROG="$__PROG --no-proxy" + # user agent string if provided + if [ -n "$user_agent" ]; then + # replace single and double quotes + user_agent=$(echo $user_agent | sed "s/'/ /g" | sed 's/"/ /g') + __PROG="$__PROG --user-agent='$user_agent'" + fi + __RUNPROG="$__PROG '$__URL'" # build final command __PROG="GNU Wget" # reuse for error logging -- cgit v1.2.3