-if [ -d "$(dirname $0)/honeynode/1.2.1/honeynode-simulator" ];then
- echo "Removing $(dirname $0)/honeynode/1.2.1/honeynode-simulator directory"
- rm -rf $(dirname $0)/honeynode/1.2.1/honeynode-simulator
-fi
-if [ -d "$(dirname $0)/honeynode/2.2.1/honeynode-simulator" ];then
- echo "Removing $(dirname $0)/honeynode/2.2.1/honeynode-simulator directory"
- rm -rf $(dirname $0)/honeynode/2.2.1/honeynode-simulator
-fi
-#download honeynode for 1.2.1 devices and install it
-#complete source code can be found at https://gitlab.com/Orange-OpenSource/lfn/odl/honeynode-simulator.git
-echo "Installing honeynode for 1.2.1 devices to $(dirname $0)/honeynode/1.2.1/honeynode-simulator directory "
-curl --location --request GET "https://gitlab.com/api/v4/projects/17518226/jobs/artifacts/honeynode-plugin-aggregator-1.0.2/download?job=mvn-build" -o $(dirname $0)/honeynode/1.2.1/artifact.zip
-unzip $(dirname $0)/honeynode/1.2.1/artifact.zip -d $(dirname $0)/honeynode/1.2.1
-rm -f $(dirname $0)/honeynode/1.2.1/artifact.zip
-#download honeynode for 2.2.1 devices and install it
-echo "Installing honeynode for 2.2.1 devices to $(dirname $0)/honeynode/2.2.1/honeynode-simulator directory "
-curl --location --request GET "https://gitlab.com/api/v4/projects/17518226/jobs/artifacts/honeynode-plugin-aggregator-2.0.2/download?job=mvn-build" -o $(dirname $0)/honeynode/2.2.1/artifact.zip
-unzip $(dirname $0)/honeynode/2.2.1/artifact.zip -d $(dirname $0)/honeynode/2.2.1
-rm -f $(dirname $0)/honeynode/2.2.1/artifact.zip
+ #clean honeynode install directory
+
+ if [ -d "$INSTALL_DIR" ];then
+ echo "Removing $INSTALL_DIR directory"
+ rm -rf $INSTALL_DIR
+ fi
+
+ #download honeynode and install it
+ #complete source code can be found at https://gitlab.com/Orange-OpenSource/lfn/odl/honeynode-simulator.git
+
+ echo "Installing honeynode for $VERSION devices to $INSTALL_DIR directory "
+ curl --retry-delay 10 --retry 3 -sS --location --request GET $TARGET_URL -o $ARTIFACT_ZIPFILE
+ unzip -q $ARTIFACT_ZIPFILE -d $TARGET_DIR
+ rm -f $ARTIFACT_ZIPFILE
+
+done
+exit