From 181cd3da63a4e391c22f260c96ebb19c3d3db930 Mon Sep 17 00:00:00 2001 From: lean Date: Wed, 25 Mar 2020 11:17:18 +0800 Subject: [PATCH] ddns-scripts: reduce I/O time --- net/ddns-scripts/Makefile | 2 +- net/ddns-scripts/files/dynamic_dns_functions.sh | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/net/ddns-scripts/Makefile b/net/ddns-scripts/Makefile index 89e7e964..baca88e4 100755 --- a/net/ddns-scripts/Makefile +++ b/net/ddns-scripts/Makefile @@ -12,7 +12,7 @@ PKG_NAME:=ddns-scripts PKG_VERSION:=2.7.8 # Release == build # increase on changes of services files or tld_names.dat -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=GPL-2.0 PKG_MAINTAINER:= diff --git a/net/ddns-scripts/files/dynamic_dns_functions.sh b/net/ddns-scripts/files/dynamic_dns_functions.sh index 7128807a..f871c6da 100755 --- a/net/ddns-scripts/files/dynamic_dns_functions.sh +++ b/net/ddns-scripts/files/dynamic_dns_functions.sh @@ -1,4 +1,4 @@ -#!/bin/sh +F#!/bin/sh # /usr/lib/ddns/dynamic_dns_functions.sh # #.Distributed under the terms of the GNU General Public License (GPL) version 2.0 @@ -80,7 +80,12 @@ WGET_SSL=$(which wget-ssl) CURL=$(which curl) # CURL_PROXY not empty then Proxy support available -CURL_PROXY=$(find /lib /usr/lib -name libcurl.so* -exec strings {} 2>/dev/null \; | grep -im1 "all_proxy") +if [ -f /tmp/vCURL_PROXY ]; then + CURL_PROXY=$(cat /tmp/vCURL_PROXY); +else + CURL_PROXY=$(find /lib /usr/lib -name libcurl.so* -exec strings {} 2>/dev/null \; | grep -im1 "all_proxy") + echo -n $CURL_PROXY >/tmp/vCURL_PROXY +fi UCLIENT_FETCH=$(which uclient-fetch) @@ -771,7 +776,13 @@ do_transfer() { # uclient-fetch possibly with ssl support if /lib/libustream-ssl.so installed elif [ -n "$UCLIENT_FETCH" ]; then # UCLIENT_FETCH_SSL not empty then SSL support available - UCLIENT_FETCH_SSL=$(find /lib /usr/lib -name libustream-ssl.so* 2>/dev/null) + if [ -f /tmp/vUCLIENT_FETCH_SSL ]; then + UCLIENT_FETCH_SSL=$(cat /tmp/vCURL_PROXY); + else + UCLIENT_FETCH_SSL=$(find /lib /usr/lib -name libustream-ssl.so* 2>/dev/null) + echo -n $UCLIENT_FETCH_SSL >/tmp/vUCLIENT_FETCH_SSL + fi + __PROG="$UCLIENT_FETCH -q -O $DATFILE" # force network/ip not supported [ -n "$__BINDIP" ] && \