30ce9df3faa7afe7802c4b4a466c1cf292d54153
[transportpce.git] / tests / install_honeynode.sh
1 #/bin/sh
2
3 #set -x
4
5 #check if curl exists
6 if ! [ -x "$(command -v curl)" ];then
7     echo "curl is not installed." >&2
8     exit 1
9 fi
10 #check if unzip exists
11 if ! [ -x "$(command -v unzip)" ];then
12     echo "unzip is not installed." >&2
13     exit 1
14 fi
15
16 #clean honeynode directories
17
18 if [ -d "$(dirname $0)/honeynode/1.2.1/honeynode-simulator" ];then
19     echo "Removing $(dirname $0)/honeynode/1.2.1/honeynode-simulator directory"
20     rm -rf $(dirname $0)/honeynode/1.2.1/honeynode-simulator
21 fi
22 if [ -d "$(dirname $0)/honeynode/2.2.1/honeynode-simulator" ];then
23     echo "Removing $(dirname $0)/honeynode/2.2.1/honeynode-simulator directory"
24     rm -rf $(dirname $0)/honeynode/2.2.1/honeynode-simulator
25 fi
26 #download honeynode for 1.2.1 devices and install it
27 #complete source code can be found at https://gitlab.com/Orange-OpenSource/lfn/odl/honeynode-simulator.git
28 echo "Installing honeynode for 1.2.1 devices to $(dirname $0)/honeynode/1.2.1/honeynode-simulator directory "
29 curl --location --request GET "https://gitlab.com/api/v4/projects/17518226/jobs/artifacts/honeynode-plugin-aggregator-1.0.4/download?job=mvn-build" -o $(dirname $0)/honeynode/1.2.1/artifact.zip
30 unzip $(dirname $0)/honeynode/1.2.1/artifact.zip -d $(dirname $0)/honeynode/1.2.1
31 rm -f $(dirname $0)/honeynode/1.2.1/artifact.zip
32 #download honeynode for 2.2.1 devices and install it
33 echo "Installing honeynode for 2.2.1 devices to $(dirname $0)/honeynode/2.2.1/honeynode-simulator directory "
34 curl --location --request GET "https://gitlab.com/api/v4/projects/17518226/jobs/artifacts/honeynode-plugin-aggregator-2.0.5/download?job=mvn-build" -o $(dirname $0)/honeynode/2.2.1/artifact.zip
35 unzip $(dirname $0)/honeynode/2.2.1/artifact.zip -d $(dirname $0)/honeynode/2.2.1
36 rm -f $(dirname $0)/honeynode/2.2.1/artifact.zip