From 5a4c7a71c4928d945d71d09d73fed3c9638931d5 Mon Sep 17 00:00:00 2001 From: Olivier Grand Date: Thu, 6 Dec 2018 12:12:29 +0100 Subject: [PATCH] fix expired token on log-bosh --- scripts/log-bosh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/log-bosh b/scripts/log-bosh index ca8a10f..696c413 100755 --- a/scripts/log-bosh +++ b/scripts/log-bosh @@ -54,6 +54,12 @@ else printf "\n\n%bERROR : Bosh director \"${BOSH_TARGET}\" unknown.%b\n\n" "${RED}" "${STD}" else status=1 + testToken=$(bosh env > /dev/null 2>&1) + if [ $? != 0 ] ; then + #--- Token expired, log out + bosh log-out > /dev/null 2>&1 + fi + userConnected=$(bosh env | grep "not logged in") if [ "${userConnected}" != "" ] ; then #--- Log into the director and list active deployments