diff --git a/bin/bubble_common b/bin/bubble_common index 1171cd54..91ec1f57 100755 --- a/bin/bubble_common +++ b/bin/bubble_common @@ -78,12 +78,20 @@ elif [[ ! -f "${BUBBLE_SCRIPTS}/run.sh" ]] ; then fi # If BUBBLE_API is defined, we may have cached credentials -if [[ ! -z "${BUBBLE_API}" ]] ; then +BUBBLE_AUTH="${HOME}/.bubble_auth" +if [[ ! -z "${BUBBLE_API}" && -d "${BUBBLE_AUTH}" ]] ; then if [[ -z "${BUBBLE_DISABLE_AUTH_CACHE}" || "${BUBBLE_DISABLE_AUTH_CACHE}" == "false" ]] ; then API_HOST="$(echo -n "${BUBBLE_API}" | awk -F '/' '{print $3}')" - USER_FILE="${HOME}/.bubble_auth/${API_HOST}/user" - PASS_FILE="${HOME}/.bubble_auth/${API_HOST}/pass" - if [[ -f ${USER_FILE} && -f ${PASS_FILE} ]] ; then + AUTH_DIR="${BUBBLE_AUTH}/${API_HOST}" + USER_FILE="${AUTH_DIR}/user" + PASS_FILE="${AUTH_DIR}/pass" + + if [[ ! -z "${BUBBLE_USER}" && -f ${PASS_FILE} ]] ; then + echo "Using cached password from ${AUTH_DIR} (set env var BUBBLE_DISABLE_AUTH_CACHE=true to disable this behavior)" + BUBBLE_PASS="$(cat "${PASS_FILE}" | tr -d '[:space:]')" + + elif [[ -f ${USER_FILE} && -f ${PASS_FILE} ]] ; then + echo "Using cached user/pass from ${AUTH_DIR} (set env var BUBBLE_DISABLE_AUTH_CACHE=true to disable this behavior)" BUBBLE_USER="$(cat "${USER_FILE}" | tr -d '[:space:]')" BUBBLE_PASS="$(cat "${PASS_FILE}" | tr -d '[:space:]')" fi diff --git a/utils/cobbzilla-wizard b/utils/cobbzilla-wizard index a7e73f4c..a320fdad 160000 --- a/utils/cobbzilla-wizard +++ b/utils/cobbzilla-wizard @@ -1 +1 @@ -Subproject commit a7e73f4cfb35ae250e59a2b01abf132bf577f899 +Subproject commit a320fdad5d4d29fdecc080c1053f9e1be7284d73