Browse Source

use _contains instead of grep

pull/4252/head
Klaus Frank 2 years ago
committed by GitHub
parent
commit
41dbf1ddac
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      acme.sh

6
acme.sh

@ -1999,7 +1999,7 @@ _post() {
if [ "$_ret" != "0" ]; then if [ "$_ret" != "0" ]; then
_err "Please refer to https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html for error code: $_ret" _err "Please refer to https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html for error code: $_ret"
fi fi
if echo $_WGET | grep -q " -d " 2>/dev/null; then
if _contains "$_WGET" " -d "; then
# Demultiplex wget debug output # Demultiplex wget debug output
cat "$HTTP_HEADER" >&2 cat "$HTTP_HEADER" >&2
_sed_i '/^[^ ][^ ]/d; /^ *$/d' "$HTTP_HEADER" _sed_i '/^[^ ][^ ]/d; /^ *$/d' "$HTTP_HEADER"
@ -2059,14 +2059,14 @@ _get() {
_debug "_WGET" "$_WGET" _debug "_WGET" "$_WGET"
if [ "$onlyheader" ]; then if [ "$onlyheader" ]; then
_wget_out = "$($_WGET --user-agent="$USER_AGENT" --header "$_H5" --header "$_H4" --header "$_H3" --header "$_H2" --header "$_H1" -S -O /dev/null "$url" 2>&1)" _wget_out = "$($_WGET --user-agent="$USER_AGENT" --header "$_H5" --header "$_H4" --header "$_H3" --header "$_H2" --header "$_H1" -S -O /dev/null "$url" 2>&1)"
if echo $_WGET | grep -q " -d " 2>/dev/null; then
if _contains "$_WGET" " -d "; then
# Demultiplex wget debug output # Demultiplex wget debug output
echo "$_wget_out" >&2 echo "$_wget_out" >&2
echo "$_wget_out" | sed '/^[^ ][^ ]/d; /^ *$/d; s/^ //g' - echo "$_wget_out" | sed '/^[^ ][^ ]/d; /^ *$/d; s/^ //g' -
fi fi
else else
$_WGET --user-agent="$USER_AGENT" --header "$_H5" --header "$_H4" --header "$_H3" --header "$_H2" --header "$_H1" -S -O - "$url" 2>"$HTTP_HEADER" $_WGET --user-agent="$USER_AGENT" --header "$_H5" --header "$_H4" --header "$_H3" --header "$_H2" --header "$_H1" -S -O - "$url" 2>"$HTTP_HEADER"
if echo $_WGET | grep -q " -d " 2>/dev/null; then
if _contains "$_WGET" " -d "; then
# Demultiplex wget debug output # Demultiplex wget debug output
cat "$HTTP_HEADER" >&2 cat "$HTTP_HEADER" >&2
_sed_i '/^[^ ][^ ]/d; /^ *$/d' "$HTTP_HEADER" _sed_i '/^[^ ][^ ]/d; /^ *$/d' "$HTTP_HEADER"

Loading…
Cancel
Save