[NFVBENCH-151] Allocate hugepages on two NUMAs in nfvbenchvm
[nfvbench.git] / docker / nfvbench-entrypoint.sh
1 #!/bin/bash
2 # Copyright 2017 Cisco Systems, Inc.  All rights reserved.
3 #
4 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
5 #    not use this file except in compliance with the License. You may obtain
6 #    a copy of the License at
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #    Unless required by applicable law or agreed to in writing, software
11 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 #    License for the specific language governing permissions and limitations
14 #    under the License.
15 #
16
17 if [ -z "$1" ] ||  [ $1 != 'start_rest_server' ]; then
18         tail -f /dev/null
19 else
20         PARAMS="--server"
21         if [ -n "$HOST" ]; then
22                 PARAMS+=" --host $HOST"
23         fi
24         if [ -n "$PORT" ]; then
25                 PARAMS+=" --port $PORT"
26         fi
27         if [ -n "$CONFIG_FILE" ]; then
28             if [ -f "$CONFIG_FILE" ]; then
29                 PARAMS+=" -c $CONFIG_FILE"
30             fi
31         fi
32         eval "nfvbench $PARAMS"
33 fi