5 VERSIONS_LIST=${@:-"1.2.1 2.2.1 7.1"}
8 if ! [ -x "$(command -v curl)" ];then
9 echo "curl is not installed." >&2
12 #check if unzip exists
13 if ! [ -x "$(command -v unzip)" ];then
14 echo "unzip is not installed." >&2
18 for VERSION in $VERSIONS_LIST
21 "1.2.1") PLUGIN_VERSION=1.0.9
23 "2.2.1") PLUGIN_VERSION=2.0.10
25 "7.1") PLUGIN_VERSION=7.1.9
27 *) echo "unsupported device version" >&2
31 TARGET_DIR=$(dirname $0)/honeynode/$VERSION
32 INSTALL_DIR=$TARGET_DIR/honeynode-simulator
33 ARTIFACT_ZIPFILE=$TARGET_DIR/artifact.zip
34 TARGET_URL="https://gitlab.com/api/v4/projects/17518226/jobs/artifacts/honeynode-plugin-aggregator-$PLUGIN_VERSION/download?job=mvn-build"
36 #clean honeynode install directory
38 if [ -d "$INSTALL_DIR" ];then
39 echo "Removing $INSTALL_DIR directory"
43 #download honeynode and install it
44 #complete source code can be found at https://gitlab.com/Orange-OpenSource/lfn/odl/honeynode-simulator.git
46 echo "Installing honeynode for $VERSION devices to $INSTALL_DIR directory "
47 curl --retry-delay 10 --retry 3 -sS --location --request GET $TARGET_URL -o $ARTIFACT_ZIPFILE || exit 2
48 unzip -q $ARTIFACT_ZIPFILE -d $TARGET_DIR
49 rm -f $ARTIFACT_ZIPFILE