0dd27d086b0162d97cde2f2086a9e6cafd2b97ca
[demo.git] / tutorials / vFWDT / playbooks / upgrade.sh
1 #!/bin/bash
2
3 # ============LICENSE_START=======================================================
4 # Copyright (C) 2019 Orange
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # ============LICENSE_END=========================================================
19
20 #change IP addresses and upload to playbooks folder darkstat and server.py before
21
22 SINK1=10.254.184.217
23 SINK2=10.254.184.210
24 VFW1=10.254.184.208
25 VFW2=10.254.184.216
26
27 echo $VFW1 > vfw_mgt_ip.txt
28 scp -oStrictHostKeyChecking=no -i onap.pem vfw_mgt_ip.txt root@$SINK1:/opt/config/
29 ssh -oStrictHostKeyChecking=no -i onap.pem root@$SINK1 /etc/init.d/darkstat stop
30 scp -oStrictHostKeyChecking=no -i onap.pem darkstat root@$SINK1:/usr/sbin/
31 ssh -oStrictHostKeyChecking=no -i onap.pem root@$SINK1 /etc/init.d/darkstat start
32
33 ssh -oStrictHostKeyChecking=no -i onap.pem root@$VFW1 "hostname > /opt/config/hostname.txt"
34 ssh -oStrictHostKeyChecking=no -i onap.pem root@$VFW1 "echo '1.0' > /opt/config/version.txt"
35 scp -oStrictHostKeyChecking=no -i onap.pem server.py root@$VFW1:/opt/config/
36 ssh -oStrictHostKeyChecking=no -i onap.pem root@$VFW1 "screen -d -m bash -c 'cd /opt/config && python3 /opt/config/server.py 80 > /dev/null 2>&1'"
37
38 echo $VFW2 > vfw_mgt_ip.txt
39 scp -oStrictHostKeyChecking=no -i onap.pem vfw_mgt_ip.txt root@$SINK2:/opt/config/
40 ssh -oStrictHostKeyChecking=no -i onap.pem root@$SINK2 /etc/init.d/darkstat stop
41 scp -oStrictHostKeyChecking=no -i onap.pem darkstat root@$SINK2:/usr/sbin/
42 ssh -oStrictHostKeyChecking=no -i onap.pem root@$SINK2 /etc/init.d/darkstat start
43
44 ssh -oStrictHostKeyChecking=no -i onap.pem root@$VFW2 "hostname > /opt/config/hostname.txt"
45 ssh -oStrictHostKeyChecking=no -i onap.pem root@$VFW2 "echo '1.0' > /opt/config/version.txt"
46 scp -oStrictHostKeyChecking=no -i onap.pem server.py root@$VFW2:/opt/config/
47 ssh -oStrictHostKeyChecking=no -i onap.pem root@$VFW2 "screen -d -m bash -c 'cd /opt/config && python3 /opt/config/server.py 80 > /dev/null 2>&1'"
48