Commit 9a423774 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Depura create-nets

Permite al script fallar si alguna red no se pudo crear y detiene el
proceso al primer error.

Corrige saltos de línea y muestra más información de salida.
parent 66de26dd
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -7,18 +7,20 @@ then
	createNetCmd="${createNetCmd} -d overlay --attachable"
fi

echo -e "  ${INFO_COLOR}command [ ${DATA_COLOR}${createNetCmd}${INFO_COLOR} ]${NULL_COLOR}\n"

# Prepara comando compuesto de creación de redes
createNetsCmd=":"
for netName in "${@}"
do
	createNetsCmd="${createNetCmd} ${netName}; ${createNetsCmd}"
	createNetsCmd="${createNetCmd} ${netName} && ${createNetsCmd}"
done

if runRemoteCmd "${createNetsCmd}"
then
	echo -e "${PASS_COLOR}Networks creation was successful!${NULL_COLOR}"
	echo -e "\n${PASS_COLOR}Networks creation was successful!${NULL_COLOR}"
else
	echo -e "${FAIL_COLOR}Networks creation failed!${NULL_COLOR}"
	echo -e "\n${FAIL_COLOR}Networks creation failed!${NULL_COLOR}"
	eval "${closeSshCmd}"
	exit 1
fi
+2 −1
Original line number Diff line number Diff line
@@ -10,7 +10,8 @@ fi

. _ssh-config.sh

echo -e "\n${INFO_COLOR}Creating networks at remote ${DATA_COLOR}${remoteHost}${INFO_COLOR} ..${NULL_COLOR}\n"
echo -e "${INFO_COLOR}Creating networks at remote ${DATA_COLOR}${remoteHost}${INFO_COLOR} ..${NULL_COLOR}"
echo -e "  ${INFO_COLOR}networks [ ${DATA_COLOR}${@}${INFO_COLOR} ]${NULL_COLOR}"

. _check-env.sh