-
Notifications
You must be signed in to change notification settings - Fork 0
/
ping_test.sh
executable file
·66 lines (53 loc) · 2.38 KB
/
ping_test.sh
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# -------------------- System: Global Variables ----------------------- #
BEOF_DIR="/root/BEOF"
HOST_EC="172.17.0.2" # EC host IP address
PORT_EC=8800 # EC port number
PORT_RC=8800 # RC port number
EC_RECV_SOCK_TIMEOUT=5 # Maximum time (in seconds) the EC will wait for RC results during exec_WR call
RC_START_RETRIES=3 # Maximum number of RC connection retries incase of failure
SYNC_CLOCKS=false # true = turn ON, false = turn OFF synchronization
OFM_MAX=0.001 # Maximum allowed Offset From Master (OFM) in seconds
VERBOSE=true # true = turn ON, false = turn OFF verbose output
GRAPH_path="http://$HOST_EC/GRAPH/GRAPH.html" # Graphing tool path
OEMV_path="http://$HOST_EC/OEMV/OEMV.html" # Orchestration and Error Message Viewer (OEMV) path
source $BEOF_DIR/global_var.sh
# -------------------- User section: Global Variables ----------------- #
RC1_CTRL_IP="172.17.0.3"
RC2_CTRL_IP="172.17.0.4"
RC3_CTRL_IP="172.17.0.5"
RC4_CTRL_IP="172.17.0.6"
declare -A GROUP_RC1=(
[CTRL_IP]=$RC1_CTRL_IP
[MCT_ADDR]=$(eval echo $RAND_MCT_ADDR)
)
declare -A GROUP_RC2=(
[CTRL_IP]=$RC2_CTRL_IP
[MCT_ADDR]=$(eval echo $RAND_MCT_ADDR)
)
declare -A GROUP_RC3=(
[CTRL_IP]=$RC3_CTRL_IP
[MCT_ADDR]=$(eval echo $RAND_MCT_ADDR)
)
declare -A GROUP_RC4=(
[CTRL_IP]=$RC4_CTRL_IP
[MCT_ADDR]=$(eval echo $RAND_MCT_ADDR)
)
# -------------------- System: Function Definition -------------------- #
source $BEOF_DIR/func_def.sh
# -------------------- User section: Function Definition -------------- #
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #
# Code inside sig_handler() function is executed up on [SIGHUP, SIGINT, SIGQUIT, SIGABRT, SIGKILL] system signals #
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #
#sig_handler()
#{
#}
# -------------------- System: Main Code ------------------------------ #
source $BEOF_DIR/wireless_conf.sh
source $BEOF_DIR/pre_main_code.sh
# -------------------- User section: Main Code ------------------------------ #
exec_WR ${GROUP_RC1[MCT_ADDR]} "ping -c 2 ${GROUP_RC2[CTRL_IP]}"
exec_WR ${GROUP_RC1[MCT_ADDR]} "ping -c 2 ${GROUP_RC3[CTRL_IP]}"
exec_WR ${GROUP_RC1[MCT_ADDR]} "ping -c 2 ${GROUP_RC4[CTRL_IP]}"
# -------------------- System: Main Code ------------------------------ #
source $BEOF_DIR/post_main_code.sh