3 DEVICE_VERSION=${1:-all}
5 # this file centralizes inb one place parameters needed by docker scripts,
6 # more especially the image lists for 1.2.1 and 2.2.1 devices.
7 # device versions supported as scripts argument are 1.2.1 and 2.2.1 and "all"
9 #IMAGE_LIST format is suffix_port : container/image name : config file to fill netconf operational datastore
11 IMAGE121_LIST="30:xpdra-1.2.1:1.2.1/oper-XPDRA.xml
12 31:roadma-1.2.1:1.2.1/oper-ROADMA.xml
13 32:roadmb-1.2.1:1.2.1/oper-ROADMB.xml
14 33:roadmc-1.2.1:1.2.1/oper-ROADMC.xml
15 34:xpdrc-1.2.1:1.2.1/oper-XPDRC.xml
16 21:roadma-full-1.2.1:1.2.1/oper-ROADMA-full.xml
17 23:roadmc-full-1.2.1:1.2.1/oper-ROADMC-full.xml
20 IMAGE221_LIST="40:xpdra-2.2.1:2.2.1/oper-XPDRA.xml
21 41:roadma-2.2.1:2.2.1/oper-ROADMA.xml
22 42:roadmb-2.2.1:2.2.1/oper-ROADMB.xml
23 43:roadmc-2.2.1:2.2.1/oper-ROADMC.xml
24 47:roadmd-2.2.1:2.2.1/oper-ROADMD.xml
25 44:xpdrc-2.2.1:2.2.1/oper-XPDRC.xml
26 45:spdra-2.2.1:2.2.1/oper-SPDRA.xml
27 46:spdrc-2.2.1:2.2.1/oper-SPDRC.xml
28 25:spdra_no_interface-2.2.1:2.2.1/oper-SPDRA_no_interface.xml
31 case "$DEVICE_VERSION" in
32 "1.2.1") IMAGE_LIST=$IMAGE121_LIST
34 "2.2.1") IMAGE_LIST=$IMAGE221_LIST
36 "all") IMAGE_LIST=$IMAGE121_LIST" "$IMAGE221_LIST
38 *) echo "unsupported device version"
44 DOCKER_IMAGE=honeynode:alpine-jre11
46 RESTCONF_PASSWORD=admin
48 then DOCKER_CMD=podman
50 if [ ! `which $DOCKER_CMD` ]
51 then echo "no docker command available" >&2
54 #if "docker ps" cannot be run without error, prepend sudo
55 if ( ! $DOCKER_CMD ps >/dev/null 2>&1 );then
56 echo "docker command only usable as root, using sudo" >&2
57 DOCKER_CMD="sudo docker"