blob: 98811de6c09049f34d8d516b5ec395dcfc4198af [file] [log] [blame]
tiernof7aa8c42016-09-06 16:43:04 +02001#!/bin/bash
2
3##
4# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
tierno9a61c6b2016-09-08 10:57:02 +02005# This file is part of openvim
tiernof7aa8c42016-09-06 16:43:04 +02006# All Rights Reserved.
7#
8# Licensed under the Apache License, Version 2.0 (the "License"); you may
9# not use this file except in compliance with the License. You may obtain
10# a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17# License for the specific language governing permissions and limitations
18# under the License.
19#
20# For those usages not covered by the Apache License, Version 2.0 please
21# contact with: nfvlabs@tid.es
22##
23
24#
25#author Alfonso Tierno
26#
27#script that obtain the parameters from the configuration file
28#it is a bit unsafe because a comment in the yaml configuration file
29#can wrong this script
30
31#get params from configuration file
32
33[ -z "$1" ] && echo "usage: $0 [openvim_cfg_file]" && exit
34
35OPENVIM_PORT=`grep http_port: $1`
36OPENVIM_PORT=${OPENVIM_PORT#http_port:}
37OPENVIM_PORT=${OPENVIM_PORT%%#*}
38OPENVIM_PORT=`eval echo ${OPENVIM_PORT}` # remove white spaces
39
40OPENVIM_ADMIN_PORT=`grep http_admin_port: $1`
41OPENVIM_ADMIN_PORT=${OPENVIM_ADMIN_PORT#http_admin_port:}
42OPENVIM_ADMIN_PORT=${OPENVIM_ADMIN_PORT%%#*}
43OPENVIM_ADMIN_PORT=`eval echo ${OPENVIM_ADMIN_PORT}` # remove white spaces
44
45OPENVIM_HOST=`grep http_host: $1`
46OPENVIM_HOST=${OPENVIM_HOST#http_host:}
47OPENVIM_HOST=${OPENVIM_HOST%%#*}
48OPENVIM_HOST=`eval echo ${OPENVIM_HOST}` # remove white spaces
49
50OPENVIM_OF_IP=`grep of_controller_ip: $1`
51OPENVIM_OF_IP=${OPENVIM_OF_IP#of_controller_ip:}
52OPENVIM_OF_IP=${OPENVIM_OF_IP%%#*}
53OPENVIM_OF_IP=`eval echo ${OPENVIM_OF_IP}` # remove white spaces
54
55OPENVIM_OF_PORT=`grep of_controller_port: $1`
56OPENVIM_OF_PORT=${OPENVIM_OF_PORT#of_controller_port:}
57OPENVIM_OF_PORT=${OPENVIM_OF_PORT%%#*}
58OPENVIM_OF_PORT=`eval echo ${OPENVIM_OF_PORT}` # remove white spaces
59
60OPENVIM_OF_DPID=`grep of_controller_dpid: $1`
61OPENVIM_OF_DPID=${OPENVIM_OF_DPID#of_controller_dpid:}
62OPENVIM_OF_DPID=${OPENVIM_OF_DPID%%#*}
63OPENVIM_OF_DPID=`eval echo ${OPENVIM_OF_DPID}` # remove white spaces
64