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 44:xpdrc-2.2.1:2.2.1/oper-XPDRC.xml
25 45:spdrav2-2.2.1:2.2.1/oper-SPDRAv2.xml
26 46:spdrav1-2.2.1:2.2.1/oper-SPDRAv1.xml
29 case "$DEVICE_VERSION" in
30 "1.2.1") IMAGE_LIST=$IMAGE121_LIST
32 "2.2.1") IMAGE_LIST=$IMAGE221_LIST
34 "all") IMAGE_LIST=$IMAGE121_LIST" "$IMAGE221_LIST
36 *) echo "unsupported device version"
42 DOCKER_IMAGE=honeynode:alpine-jre11
44 RESTCONF_PASSWORD=admin
46 then DOCKER_CMD=podman
48 if [ ! `which $DOCKER_CMD` ]
49 then echo "no docker command available" >&2
52 #if "docker ps" cannot be run without error, prepend sudo
53 if ( ! $DOCKER_CMD ps >/dev/null 2>&1 );then
54 echo "docker command only usable as root, using sudo" >&2
55 DOCKER_CMD="sudo docker"