clean test environment
[transportpce.git] / tests / honeynode / 2.2.1 / minimal-distribution-core / src / main / resources / honeycomb-minimal-resources / honeycomb-tpce
1 #!/bin/sh -
2 STATUS=100
3
4 if [ "$#" -ge 2 ]
5 then
6     PORT=$1
7     CONFIG=$2
8     if [ -e $CONFIG ]
9     then
10         cp $CONFIG $(dirname $0)/config/device/
11         filename=$(basename -- "$CONFIG")
12         echo "changing netconf port with $PORT in netconf.json file ..."
13         sed -i "/netconf-ssh-binding-port/c\  \"netconf-ssh-binding-port\" : "$PORT"," $(dirname $0)/config/netconf.json
14         echo "changing persist-context and persist-config to false in honeycomb.json file ..."
15         sed -i "/persist-context/c\  \"persist-context\" : \"false\"," $(dirname $0)/config/honeycomb.json
16         sed -i "/persist-config/c\  \"persist-config\" : \"false\"," $(dirname $0)/config/honeycomb.json
17         echo "changing netconf-initial-config-xml location with $CONFIG in honeycomb.json file ..."
18         sed -i "/netconf-initial-config-xml/c\  \"netconf-initial-config-xml\" : \"device/$filename\"," $(dirname $0)/config/honeycomb.json
19          while [ $STATUS -eq 100 ]
20          do
21            java -Xms512m -Xmn512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -jar $(dirname $0)/honeynode-distribution-1.18.01.jar
22            STATUS=$?
23            echo "Honeycomb exited with status: $STATUS"
24            if [ $STATUS -eq 100 ]
25            then
26              echo "Restarting..."
27            fi
28          done
29     else
30         echo "initial config file doesn't exist !"
31     fi
32 else 
33     echo "honeycomb-tpce port initial-config-xml (option)pm-list-xml"
34     echo "Eg : honeycomb-tpce 17832 sample-config-ROADM.xml pm-list.xml"
35 fi