diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-08-30 21:53:52 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-08-30 22:17:35 +0200 |
commit | 396aa84d2521516168cf0e3e8119d550327dff45 (patch) | |
tree | 55850b5786b737907031b8e53bd74fb099f983d9 | |
parent | 52c9bdcb2f9fc6b33fd984a794f43c1f9324e5c2 (diff) |
Fixed again freeze when iot.bzh website is not accessiblev0.2.2
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
-rwxr-xr-x | scripts/xds-utils/get-xds-agent.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/xds-utils/get-xds-agent.sh b/scripts/xds-utils/get-xds-agent.sh index 0404dac..d2f7024 100755 --- a/scripts/xds-utils/get-xds-agent.sh +++ b/scripts/xds-utils/get-xds-agent.sh @@ -5,6 +5,13 @@ [ -z "$XDS_AGENT_BASEURL" ] && XDS_AGENT_BASEURL="http://iot.bzh/download/public/2017/XDS/xds-agent/" [ -z "$DEST_DIR" ] && DEST_DIR=./webapp/dist/assets/xds-agent-tarballs +# Fisrt check if we can access to iot.bzh (aka ovh.iot) +ping -c 1 -W 2 www.ovh.iot > /dev/null +if [ "$?" != "0" ]; then + echo "iot.bzh website not accessible !" + exit 1 +fi + TARBALLS=$(curl -s ${XDS_AGENT_BASEURL} | grep -oP 'href="[^"]*.zip"' | cut -d '"' -f 2) usage() { @@ -39,13 +46,6 @@ if [ ! -d ${DEST_DIR} ]; then exit 1 fi -# Fisrt check if we can access to iot.bzh (aka ovh.iot) -ping -c 1 -W 5 www.ovh.iot > /dev/null -if [ "$?" != "0" ]; then - echo "iot.bzh website not accessible !" - exit 1 -fi - # Get not existing tarballs exitCode=0 for file in $TARBALLS; do |