shellcheck fixes

This commit is contained in:
Oleg Zaikin 2018-09-12 11:06:48 +03:00
parent 5e6163fc87
commit 37c3176945

View File

@ -110,8 +110,8 @@ _clodo_init() {
_get $CLODO_AUTH_URL "onlyheader" _get $CLODO_AUTH_URL "onlyheader"
CLODO_TOKEN=$(grep "^X-Auth-Token" $HTTP_HEADER | tr -d "\r" | cut -d " " -f 2) CLODO_TOKEN=$(grep "^X-Auth-Token" "$HTTP_HEADER" | tr -d "\r" | cut -d " " -f 2)
CLODO_API=$(grep "^X-Server-Management-Url" $HTTP_HEADER | tr -d "\r" | cut -d " " -f 2) CLODO_API=$(grep "^X-Server-Management-Url" "$HTTP_HEADER" | tr -d "\r" | cut -d " " -f 2)
if [ -z "$CLODO_TOKEN" ] || [ -z "$CLODO_API" ]; then if [ -z "$CLODO_TOKEN" ] || [ -z "$CLODO_API" ]; then
_err "Authentication error" _err "Authentication error"
@ -168,7 +168,9 @@ _clodo_rest() {
else else
response="$(_get "$CLODO_API/$ep")" response="$(_get "$CLODO_API/$ep")"
fi fi
if [ "$?" != "0" ]; then
_ret=$?
if [ "$_ret" != "0" ]; then
_err "error $ep" _err "error $ep"
return 1 return 1
fi fi