forked from yanet-platform/yanet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyanet-wrapper
executable file
·44 lines (37 loc) · 885 Bytes
/
yanet-wrapper
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
set -Eeuo pipefail
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
ARCH=""
BINARY="dataplane"
CONFIG=""
TYPE=""
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [OPTIONS]
YANET wrapper.
Options:
-h Print this help and exit
-a Instruction set architecture host (corei7, broadwell, knl)
-b Set binary (dataplane, controlplane)
-c Config file
-t Type of yanet binary (release, l3balancer or firewall)
EOF
exit
}
while getopts "h:a:b:c:t:" opt ; do
case $opt in
h) usage ;;
a) ARCH=$OPTARG ;;
b) BINARY=$OPTARG ;;
c) CONFIG=$OPTARG ;;
t) TYPE=$OPTARG ;;
*) usage ;;
esac
done
if [ "$BINARY" = "dataplane" ]; then
/usr/bin/yanet-$BINARY-$ARCH-$TYPE -c $CONFIG
elif [ "$BINARY" = "controlplane" ]; then
/usr/bin/yanet-$BINARY-$ARCH -c $CONFIG
else
false
fi