diff --git a/scripts/log-fly b/scripts/log-fly index f7574ae..a95062b 100755 --- a/scripts/log-fly +++ b/scripts/log-fly @@ -37,6 +37,21 @@ if [ $? != 0 ] ; then fi fi +#--- Choose which team to access +flag=0 +while [ ${flag} = 0 ] ; do + flag=1 + printf "\n%bTeam concourse :%b\n\n" "${REVERSE}${GREEN}" "${STD}" + printf "%b1%b : main\n" "${GREEN}${BOLD}" "${STD}" + printf "%b2%b : upload\n" "${GREEN}${BOLD}" "${STD}" + printf "\n%bYour choice :%b " "${GREEN}${BOLD}" "${STD}" ; read choice + case "${choice}" in + 1) TEAM="main" ;; + 2) TEAM="upload" ;; + *) flag=0 ; clear ;; + esac +done + #--- Log to fly if [ ${flagError} = 0 ] ; then getCredhub "OPS_DOMAIN" "/secrets/cloudfoundry_ops_domain" @@ -50,7 +65,7 @@ if [ ${flagError} = 0 ] ; then fi done fi - fly login -c https://elpaaso-concourse-micro.${OPS_DOMAIN} -k -u atc -p ${FLY_PASSWORD} + fly login -c https://elpaaso-concourse-micro.${OPS_DOMAIN} -k -u atc -p ${FLY_PASSWORD} -n ${TEAM} if [ $? != 0 ] ; then FLY_PASSWORD="" printf "\n\n%bERROR : Connexion failed.%b\n\n" "${RED}" "${STD}"