From 744172e5c91fd7c83765e58569253b53a8b64f9e Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 16 Jan 2019 22:02:19 +0000 Subject: [PATCH] etc/profile.d/nb.sh --- etc/profile.d/nb.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 } -- 2.47.3