aboutsummaryrefslogtreecommitdiffstats
path: root/nfvbenchvm/dib/elements/nfvbenchvm/static/nfvbench/start-nfvbench.sh
diff options
context:
space:
mode:
authorfmenguy <francoisregis.menguy@orange.com>2020-11-16 17:01:33 +0100
committerfmenguy <francoisregis.menguy@orange.com>2021-04-28 11:00:55 +0200
commit83c4a7885d7c32901ff7335bdbef9d8d9f4417d7 (patch)
treea9a9a5ed6f6e6ef5eb3413d5d9be809409b8e719 /nfvbenchvm/dib/elements/nfvbenchvm/static/nfvbench/start-nfvbench.sh
parentffa058dfad5d98c6af50126748cd5798ed7b3d94 (diff)
NFVBENCH-196: New NFVbench image for generator part (nfvbench and TRex codes inside VM)5.0.0
Change-Id: Id919a1b9dbf5e04b198d022432ed5c64232a27ba Signed-off-by: fmenguy <francoisregis.menguy@orange.com>
Diffstat (limited to 'nfvbenchvm/dib/elements/nfvbenchvm/static/nfvbench/start-nfvbench.sh')
-rw-r--r--nfvbenchvm/dib/elements/nfvbenchvm/static/nfvbench/start-nfvbench.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/static/nfvbench/start-nfvbench.sh b/nfvbenchvm/dib/elements/nfvbenchvm/static/nfvbench/start-nfvbench.sh
new file mode 100644
index 0000000..1f6fa28
--- /dev/null
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/static/nfvbench/start-nfvbench.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+
+restart_nfvbench_service(){
+ service nfvbench restart
+ echo "NFVbench running in screen 'nfvbench'"
+ logger "NFVBENCHVM: NFVbench running in screen 'nfvbench'"
+}
+
+start_nfvbench(){
+ ln -sfn /etc/nfvbench/nfvbench.cfg /etc/nfvbench/nfvbench.conf
+ restart_nfvbench_service
+}
+
+start_nfvbench_e2e_mode(){
+ ln -sfn /etc/nfvbench/e2e.cfg /etc/nfvbench/nfvbench.conf
+ restart_nfvbench_service
+}
+
+start_nfvbench_loopback_mode(){
+ ln -sfn /etc/nfvbench/loopback.cfg /etc/nfvbench/nfvbench.conf
+ restart_nfvbench_service
+}
+
+usage() {
+ echo "Usage: $0 action"
+ echo "action (optional):"
+ echo "e2e start NFVbench with E2E config file"
+ echo "loopback start NFVbench with loopback config file"
+ echo ""
+ echo "If no action is given NFVbench will start with default config file"
+ exit 1
+}
+
+# ----------------------------------------------------------------------------
+# Parse command line options and configure the script
+# ----------------------------------------------------------------------------
+if [ "$#" -lt 1 ]; then
+ start_nfvbench
+ exit 0
+else
+ if [ $1 = "e2e" ]; then
+ start_nfvbench_e2e_mode
+ exit 0
+ elif [ $1 = "loopback" ]; then
+ start_nfvbench_loopback_mode
+ exit 0
+ else
+ usage
+ fi
+fi