From: Nicolas Boisselier Date: Wed, 16 Jan 2019 22:02:19 +0000 (+0000) Subject: etc/profile.d/nb.sh X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=744172e5c91fd7c83765e58569253b53a8b64f9e;p=nb.git etc/profile.d/nb.sh --- diff --git a/etc/profile.d/nb.sh b/etc/profile.d/nb.sh index 2c156163..7bc3ab00 100644 --- a/etc/profile.d/nb.sh +++ b/etc/profile.d/nb.sh @@ -83,11 +83,12 @@ nb_php() { nb_api() { local uri="$1"; shift - #echo "https://api.nbdom.net$uri $@"; return 0; - if [ -z "$NB_AUTH" -o x = x$(awk '/^machine api.nbdom.net / { print $4":"$6}' $HOME/.netrc 2> /dev/null) ]; then - curl -sfS -u "$NB_AUTH" "https://api.nbdom.net$uri" "$@" + + if [ -n "$NB_AUTH" -a x = x$(awk '/^machine api.nbdom.net / { print $4":"$6}' $HOME/.netrc 2> /dev/null) ]; then +# NB 16.01.19 if [ -z "$NB_AUTH" -o x = x$(awk '/^machine api.nbdom.net / { print $4":"$6}' $HOME/.netrc 2> /dev/null) ]; then + echo curl -sfS -u "$NB_AUTH" "https://api.nbdom.net$uri" "$@" else - curl -sfS --netrc-optional "https://api.nbdom.net$uri" "$@" + echo curl -sfS --netrc-optional "https://api.nbdom.net$uri" "$@" fi }