-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecute_me.sh
More file actions
805 lines (671 loc) · 19.1 KB
/
execute_me.sh
File metadata and controls
805 lines (671 loc) · 19.1 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
#!/bin/bash
#version 2.0
start_trace_sbc()
{
echo "################################################################################"
echo
echo
echo " STARTING TRACE FOR SBC "
echo
echo
echo "################################################################################"
echo
sleep 7s
echo
echo
echo
path=${10}
folder=$1
oam_ip=$2
user=$3
pwd=$4
cfed_status=$5
dfed_status=$6
bgc_status=$7
fw_status=$8
sc_status=$9
timer=${11}
tc_name=${12}
cd script
./copy_oam_script.sh $oam_ip $user $pwd
./start_trace_sbc.sh $oam_ip $user $pwd $cfed_status $dfed_status $bgc_status $fw_status $sc_status $path $timer $tc_name
cd ..
echo 'T' >> status.txt
}
stop_trace_sbc()
{
echo "################################################################################"
echo
echo
echo " STOPPING TRACE FOR SBC "
echo
echo
echo "################################################################################"
echo
sleep 7s
echo
path=${11}
folder=$1
oam_ip=$2
user=$3
pwd=$4
cfed_status=$5
dfed_status=$6
bgc_status=$7
fw_status=$8
master_status=$9
sc_status=${10}
tc_name=${12}
cd $folder
mkdir SBC
cd SBC
if [[ "$cfed_status" == "T" ]]; then
mkdir CFED
fi
if [[ "$dfed_status" == "T" ]]; then
mkdir DFED
fi
if [[ "$fw_status" == "T" ]]; then
mkdir FW
fi
if [[ "$bgc_status" == "T" ]]; then
mkdir BGC
fi
if [[ "$master_status" == "T" ]]; then
mkdir MASTER
fi
if [[ "$sc_status" == "T" ]]; then
mkdir SC
fi
cd ..
cd ..
cd script
./stop_trace_sbc.sh $oam_ip $user $pwd $cfed_status $dfed_status $bgc_status $fw_status $master_status $sc_status $tc_name
sleep 5s
./ship_pcap_files.sh $oam_ip $user $pwd $path $folder $cfed_status $dfed_status $bgc_status $fw_status $master_status $sc_status $tc_name
cd ..
}
start_trace_mrf()
{
echo "################################################################################"
echo
echo " STARTING TRACE FOR MRF "
echo
echo
echo "################################################################################"
echo
sleep 7s
echo
folder=$1
mrf_ip=$2
user=$3
pwd=$4
timer=$5
tc_name=${6}
cd script
./start_trace_mrf.sh $mrf_ip $user $pwd $timer $tc_name
cd ..
echo 'T' >> status.txt
}
stop_trace_mrf()
{
echo "################################################################################"
echo
echo
echo " STOPPING TRACE FOR MRF "
echo
echo
echo "################################################################################"
echo
sleep 7s
echo
path="/drives/c/VLCC"
folder=$1
mrf_ip=$2
user=$3
pwd=$4
tc_name=${5}
cd $folder
mkdir MRF
cd ..
cd script
./stop_trace_mrf.sh $mrf_ip $user $pwd $path $folder $tc_name
./ship_pcap_files_mrf.sh $mrf_ip $user $pwd $path $folder $tc_name
cd ..
}
start_trace_cfx()
{
echo "################################################################################"
echo
echo
echo " STARTING TRACE FOR CFX "
echo
echo
echo "################################################################################"
echo
sleep 7s
echo
path="/drives/c/VLCC"
folder=$1
cif_ip=$2
user=$3
pwd=$4
cif_status=$5
tdcore_status=$6
multi_ip=$7
timer=$8
tc_name=${9}
cd script
./copy_cfx_script.sh $cif_ip $user $pwd
./start_trace_cfx.sh $cif_ip $user $pwd $path $folder
./copy_ip_cfx.sh $cif_ip $user $pwd $path
chmod 755 *
if [[ "$multi_ip" == "F" ]]; then
cif_act=$(cat cif)
./start_trace_cfx_acif.sh $cif_ip $user $pwd $cif_act $timer $tc_name
ltd=$(cat ltd)
./start_trace_cfx_l2td.sh $cif_ip $user $pwd $ltd $timer $tc_name
fi
if [[ "$multi_ip" == "T" ]]; then
cif_act=$(cat cif)
./start_trace_cfx_acif.sh $cif_ip $user $pwd $cif_act $timer $tc_name
cat tdcore | while read line
do
echo
echo
echo
echo
./start_trace_cfx_tdcore.sh $cif_ip $user $pwd $line $timer $tc_name
done
fi
# if [[ "$cif_status" == "T" ]]; then
# cif_act=$(cat cif)
# ./start_trace_cfx_acif.sh $cif_ip $user $pwd $cif_act
# fi
# if [[ "$l2td_status" == "T" ]]; then
# ltd=$(cat ltd)
# ./start_trace_cfx_l2td.sh $cif_ip $user $pwd $ltd
# fi
# if [[ "$tdcore_status" == "T" ]]; then
# cat tdcore | while read line
# do
# echo
# echo
# echo
# echo
# ./start_trace_cfx_tdcore.sh $cif_ip $user $pwd $line
# done
# fi
cd ..
echo 'T' >> status.txt
}
stop_trace_cfx()
{
echo "################################################################################"
echo
echo
echo " STOPPING TRACE FOR CFX "
echo
echo
echo "################################################################################"
echo
sleep 7s
echo
path="/drives/c/VLCC"
folder=$1
cif_ip=$2
user=$3
pwd=$4
cif_status=$5
tdcore_status=$6
multi_ip=$7
tc_name=$8
folder_path=${path}/${folder}
cd $folder
mkdir CFX
#cd CFX
chmod 755 *
if [[ "$multi_ip" == "F" ]]; then
cd CFX
mkdir CIF
mkdir L2TD
cd ..
cd ..
cd script
cif_act=$(cat cif)
./get_process_id.sh $cif_ip $user $pwd $cif_act
echo
echo
chmod 755 process_id
echo
echo "permission "
echo "$tc_name"
proc_id=$(grep $tc_name process_id | awk '{print $2}')
echo "$proc_id"
./stop_trace_cfx_acif.sh $cif_ip $user $pwd $cif_act $proc_id $tc_name $folder_path
ltd=$(cat ltd)
./get_process_id.sh $cif_ip $user $pwd $ltd_act
chmod 755 process_id
proc_id=$(grep $tc_name process_id | awk '{print $2}')
./stop_trace_cfx_l2td.sh $cif_ip $user $pwd $ltd $proc_id $tc_name $folder_path
cd ..
cd $folder
fi
if [[ "$multi_ip" == "T" ]]; then
cd CFX
mkdir CIF
mkdir TDCORE
cd ..
cd ..
cd script
cif_act=$(cat cif)
./get_process_id.sh $cif_ip $user $pwd $cif_act
chmod 755 process_id
proc_id=$(grep $tc_name process_id | awk '{print $2}')
./stop_trace_cfx_acif.sh $cif_ip $user $pwd $cif_act $proc_id $tc_name $folder_path
cat tdcore | while read line
do
echo
./get_process_id.sh $cif_ip $user $pwd $line
chmod 755 process_id
proc_id=$(grep $tc_name process_id | awk '{print $2}')
./stop_trace_cfx_tdcore.sh $cif_ip $user $pwd $line $proc_id $tc_name $folder_path
echo
echo
done
fi
# if [[ "$cif_status" == "T" ]]; then
# cd CFX
# mkdir CIF
# cd ..
# cd ..
# cd script
# cif_act=$(cat cif)
# ./stop_trace_cfx_acif.sh $cif_ip $user $pwd $cif_act
# cd ..
# cd $folder
# fi
# if [[ "$cif_status" == "T" ]]; then
# cd CFX
# mkdir L2TD
# cd ..
# cd ..
# cd script
# ltd=$(cat ltd)
# ./stop_trace_cfx_l2td.sh $cif_ip $user $pwd $ltd
# cd ..
# cd $folder
# fi
# if [[ "$tdcore_status" == "T" ]]; then
# cd CFX
# mkdir TDCORE
# cd ..
# cd ..
# cd script
# cat tdcore | while read line
# do
# echo
# ./stop_trace_cfx_tdcore.sh $cif_ip $user $pwd $line
# echo
# echo
# done
# fi
cd ..
cd script
sleep 5s
./ship_pcap_files_cfx.sh $cif_ip $user $pwd $path $folder $cif_status $tdcore_status $multi_ip
cd ..
}
start_trace_tas()
{
echo "################################################################################"
echo
echo " STARTING TRACE FOR TAS "
echo
echo
echo "################################################################################"
echo
sleep 7s
echo
path="/drives/c/VLCC"
folder=$1
tas_ip=$2
user=$3
pwd="$4"
command="$5"
precall_subs_data=$6
grep 'TAS_IMPU' edit_me.txt | cut -d " " -f 2 > script/tas_impu
cd script
touch TAS_PRE_CALL_SUBSDATA.txt
chmod 755 tas_impu TAS_PRE_CALL_SUBSDATA.txt
True="T"
if [ "$precall_subs_data" = "T" ]
then
cat tas_impu | while read line
do
echo
echo
echo
echo
./get_precall_subdata_tas.sh $tas_ip $user $pwd $line
done
fi
./start_trace_tas.sh $tas_ip $user $pwd $command
cd ..
echo 'T' >> status.txt
}
stop_trace_tas()
{
echo "################################################################################"
echo
echo
echo " STOPPING TRACE FOR TAS "
echo
echo
echo "################################################################################"
echo
sleep 7s
echo
path="/drives/c/VLCC/"
folder=$1
tas_ip=$2
user=$3
pwd="$4"
command="$5"
postcall_subs_data=$6
cd $folder
mkdir TAS
cd ..
cd script
touch TAS_POST_CALL_SUBSDATA.txt
./stop_trace_tas.sh $tas_ip $user $pwd $command
./ship_pcap_files_tas.sh $tas_ip $user $pwd $path $folder
chmod 755 tas_impu TAS_POST_CALL_SUBSDATA.txt
True="T"
if [ "$postcall_subs_data" = "T" ]
then
cat tas_impu | while read line
do
echo
echo
echo
echo
./get_postcall_subdata_tas.sh $tas_ip $user $pwd $line
done
fi
chmod 755 *
cd ..
mkdir $folder/TAS/SUBS_DATA
mv script/TAS_PRE_CALL_SUBSDATA.txt $folder/TAS/SUBS_DATA
mv script/TAS_POST_CALL_SUBSDATA.txt $folder/TAS/SUBS_DATA
}
Main()
{
start=`date +%s`
dos2unix edit_me.txt
tc_name=$2
SBC=$(grep -m 1 -w 'SBC' edit_me.txt | cut -d "=" -f 2)
CFX=$(grep -m 1 -w 'CFX' edit_me.txt | cut -d "=" -f 2)
TAS=$(grep -m 1 -w 'TAS' edit_me.txt | cut -d "=" -f 2)
MRF=$(grep -m 1 -w 'MRF' edit_me.txt | cut -d "=" -f 2)
DIR=$(grep -m 1 -w 'PATH' edit_me.txt | cut -d "=" -f 2)
TIMER=$(grep -m 1 -w 'TIMER' edit_me.txt | cut -d "=" -f 2)
MERGECAP=$(grep -m 1 -w 'MERGECAP' edit_me.txt | cut -d "=" -f 2)
sleep 2s
True="T"
touch status.txt
count=0
if [[ "$SBC" == "$True" ]]; then
count=$(( $count + 1 ))
fi
if [[ "$MRF" == "$True" ]]; then
count=$(( $count + 1 ))
fi
if [[ "$TAS" == "$True" ]]; then
count=$(( $count + 1 ))
fi
if [[ "$CFX" == "$True" ]]; then
count=$(( $count + 1 ))
fi
#echo "Count $count"
echo "################################################################################"
echo
echo
echo " TRACE CAPTURE TOOL v2.0 "
echo
echo
echo "################################################################################"
echo
echo
#read -p "Enter 1 to Start Trace, Enter 2 to Stop Trace : " ch
dos2unix *.sh
dos2unix script/*
chmod 755 script/*
folder=$(date +%d_%b_%Y_%H_%M_%S)"_TC_Name_"$2
#mkdir $folder
if [ $3 == "start" ]
then
echo "Trace Capture Initiated wait till it get's started"
echo "***************************************************"
echo
echo
if [[ "$SBC" == "$True" ]]; then
SBC_IP=$(grep -m2 -w 'SBC_IP' edit_me.txt | cut -d "=" -f 2)
SBC_USER=$(grep -m2 -w 'SBC_USER' edit_me.txt | cut -d "=" -f 2)
SBC_PASSWORD=$(grep -m2 -w 'SBC_PASSWORD' edit_me.txt | cut -d "=" -f 2)
CFED=$(grep -m 1 -w 'SBC_CFED_PCAP' edit_me.txt | cut -d "=" -f 2)
DFED=$(grep -m 1 -w 'SBC_DFED_PCAP' edit_me.txt | cut -d "=" -f 2)
BGC=$(grep -m 1 -w 'SBC_BGC_PCAP' edit_me.txt | cut -d "=" -f 2)
FW=$(grep -m 1 -w 'SBC_FW_PCAP' edit_me.txt | cut -d "=" -f 2)
SC=$(grep -m 1 -w 'SBC_SC_PCAP' edit_me.txt | cut -d "=" -f 2)
echo -e "SBC Trace is \e[1;32m applicable\e[0m to below"
#echo "SBC=T"
grep -i 'SBC_.*=T' edit_me.txt
echo "*********************************"
echo
start_trace_sbc $folder $SBC_IP $SBC_USER $SBC_PASSWORD $CFED $DFED $BGC $FW $SC $DIR $TIMER $tc_name > sbc.log &
#echo "SBC Trace is enabled"
else
echo -e "SBC Trace is \e[1;31m Not applicable\e[0m"
echo "*********************************"
echo
fi
end=`date +%s`
#echo "Trace Capture Started for SBC",$((end-start))
if [[ "$TAS" == "$True" ]]; then
TAS_IP=$(grep -m2 -w 'TAS_IP' edit_me.txt | cut -d "=" -f 2)
TAS_USER=$(grep -m2 -w 'TAS_USER' edit_me.txt | cut -d "=" -f 2)
TAS_PASSWORD=$(grep -m2 -w 'TAS_PASSWORD' edit_me.txt | cut -d "=" -f 2)
TAS_COMMAND=$(grep -m2 -w 'TAS_COMMAND' edit_me.txt | cut -d "=" -f 2)
TAS_SUBS_DATA=$(grep -m2 -w 'GETSUBSDATA_TAS' edit_me.txt | cut -d "=" -f 2)
echo -e "TAS Trace is \e[1;32m applicable\e[0m"
#echo "TAS=T"
grep -i 'TAS_.*=T' edit_me.txt
echo "*********************************"
echo
start_trace_tas $folder $TAS_IP $TAS_USER $TAS_PASSWORD $TAS_COMMAND $TAS_SUBS_DATA > tas.log &
#echo "TAS Trace is Enabled "
else
echo -e "TAS Trace is \e[1;31m Not applicable\e[0m"
echo "*********************************"
echo
fi
if [[ "$MRF" == "$True" ]]; then
MRF_IP=$(grep -m2 -w 'MRF_IP' edit_me.txt | cut -d "=" -f 2)
MRF_USER=$(grep -m2 -w 'MRF_USER' edit_me.txt | cut -d "=" -f 2)
MRF_PASSWORD=$(grep -m2 -w 'MRF_PASSWORD' edit_me.txt | cut -d "=" -f 2)
echo -e "MRF Trace is \e[1;32m applicable\e[0m"
#echo "MRF=T"
grep -i 'MRF_.*=T' edit_me.txt
echo "*********************************"
echo
start_trace_mrf $folder $MRF_IP $MRF_USER $MRF_PASSWORD $TIMER $tc_name > mrf.log &
#echo "MRF Trace is Enabled "
else
echo -e "MRF Trace is \e[1;31m Not applicable\e[0m"
echo "*********************************"
echo
fi
if [[ "$CFX" == "$True" ]]; then
CFX_IP=$(grep -m2 -w 'CFX_IP' edit_me.txt | cut -d "=" -f 2)
CFX_USER=$(grep -m2 -w 'CFX_USER' edit_me.txt | cut -d "=" -f 2)
CFX_PASSWORD=$(grep -m2 -w 'CFX_PASSWORD' edit_me.txt | cut -d "=" -f 2)
MULTI_IP=$(grep -m2 -w 'Multi_IP' edit_me.txt | cut -d "=" -f 2)
CIF=$(grep -m 1 -w 'CFX_CIF_PCAP' edit_me.txt | cut -d "=" -f 2)
TDCORE=$(grep -m 1 -w 'CFX_TDCORE_PCAP' edit_me.txt | cut -d "=" -f 2)
echo -e "CFX Trace is \e[1;32m applicable\e[0m to below VM's"
#echo "CFX=T"
grep -i 'CFX_.*=T' edit_me.txt
echo "*********************************"
echo
start_trace_cfx $folder $CFX_IP $CFX_USER $CFX_PASSWORD $CIF $TDCORE $MULTI_IP $TIMER $tc_name > cfx.log &
#echo "CFX Trace is Enabled "
else
echo -e "CFX Trace is \e[1;31m Not applicable\e[0m"
fi
echo -e "\e[1;33m Below points to be remembered\e[0m"
echo "###############################################################################################"
echo "1) Trace once started needs to be stopped"
echo -e "2) If\e[1;33m Ctrl+C\e[0m pressed in between make sure you stop the trace capture by running bellow command"
echo -e " \e[1;32m ./execute_me.sh <pass_key> <test_case_name> stop\e[0m"
echo "###############################################################################################"
end=`date +%s`
#echo "All Trace Capture Started",$((end-start))
echo
echo "$count"
while true
do
line_count=$(wc -l < status.txt)
if [[ "$line_count" == "$count" ]]; then
> status.txt
echo "Trace Capture Started"
exit
fi
sleep 5
done
elif [ $3 == "stop" ]
then
mkdir $folder
if [[ "$SBC" == "$True" ]]; then
SBC_IP=$(grep -m2 -w 'SBC_IP' edit_me.txt | cut -d "=" -f 2)
SBC_USER=$(grep -m2 -w 'SBC_USER' edit_me.txt | cut -d "=" -f 2)
SBC_PASSWORD=$(grep -m2 -w 'SBC_PASSWORD' edit_me.txt | cut -d "=" -f 2)
CFED=$(grep -m 1 -w 'SBC_CFED_PCAP' edit_me.txt | cut -d "=" -f 2)
DFED=$(grep -m 1 -w 'SBC_DFED_PCAP' edit_me.txt | cut -d "=" -f 2)
BGC=$(grep -m 1 -w 'SBC_BGC_PCAP' edit_me.txt | cut -d "=" -f 2)
FW=$(grep -m 1 -w 'SBC_FW_PCAP' edit_me.txt | cut -d "=" -f 2)
MASTER=$(grep -m 1 -w 'SBC_MASTER_LOG' edit_me.txt | cut -d "=" -f 2)
SC=$(grep -m 1 -w 'SBC_SC_PCAP' edit_me.txt | cut -d "=" -f 2)
stop_trace_sbc $folder $SBC_IP $SBC_USER $SBC_PASSWORD $CFED $DFED $BGC $FW $MASTER $SC $DIR $tc_name
else
echo -e "SBC Trace is \e[1;31m Not applicable\e[0m"
fi
end=`date +%s`
echo "Trace Capture Stoped for SBC",$((end-start))
if [[ "$TAS" == "$True" ]]; then
TAS_IP=$(grep -m2 -w 'TAS_IP' edit_me.txt | cut -d "=" -f 2)
TAS_USER=$(grep -m2 -w 'TAS_USER' edit_me.txt | cut -d "=" -f 2)
TAS_PASSWORD=$(grep -m2 -w 'TAS_PASSWORD' edit_me.txt | cut -d "=" -f 2)
TAS_COMMAND=$(grep -m2 -w 'TAS_COMMAND' edit_me.txt | cut -d "=" -f 2)
TAS_SUBS_DATA=$(grep -m2 -w 'GETSUBSDATA_TAS' edit_me.txt | cut -d "=" -f 2)
stop_trace_tas $folder $TAS_IP $TAS_USER $TAS_PASSWORD $TAS_COMMAND $TAS_SUBS_DATA
else
echo -e "TAS Trace is \e[1;31m Not applicable\e[0m"
fi
if [[ "$MRF" == "$True" ]]; then
MRF_IP=$(grep -m2 -w 'MRF_IP' edit_me.txt | cut -d "=" -f 2)
MRF_USER=$(grep -m2 -w 'MRF_USER' edit_me.txt | cut -d "=" -f 2)
MRF_PASSWORD=$(grep -m2 -w 'MRF_PASSWORD' edit_me.txt | cut -d "=" -f 2)
stop_trace_mrf $folder $MRF_IP $MRF_USER $MRF_PASSWORD $tc_name
else
echo -e "MRF Trace is \e[1;31m Not applicable\e[0m"
fi
if [[ "$CFX" == "$True" ]]; then
CFX_IP=$(grep -m2 -w 'CFX_IP' edit_me.txt | cut -d "=" -f 2)
CFX_USER=$(grep -m2 -w 'CFX_USER' edit_me.txt | cut -d "=" -f 2)
CFX_PASSWORD=$(grep -m2 -w 'CFX_PASSWORD' edit_me.txt | cut -d "=" -f 2)
CIF=$(grep -m 1 -w 'CFX_CIF_PCAP' edit_me.txt | cut -d "=" -f 2)
TDCORE=$(grep -m 1 -w 'CFX_TDCORE_PCAP' edit_me.txt | cut -d "=" -f 2)
MULTI_IP=$(grep -m 1 -w 'Multi_IP' edit_me.txt | cut -d "=" -f 2)
stop_trace_cfx $folder $CFX_IP $CFX_USER $CFX_PASSWORD $CIF $TDCORE $MULTI_IP $tc_name
else
echo -e "CFX Trace is \e[1;31m Not applicable\e[0m"
fi
if [[ "$MERGECAP" == "T" ]]; then
cd $folder
mkdir PCAP
if [[ "$TAS" == "$True" ]]; then
cd ..
cd /drives/c/VLCC/$folder/TAS/
tar -czvf volte.tar.gz volte
fi
cd ..
cd /drives/c/VLCC/$folder/
find . -name '*.gz' -execdir gunzip '{}' \;
find . -name '*.tar' -execdir tar -xvf '{}' \;
find . -name '*.pcap' -exec mv {} /cygdrive/c/VLCC/$folder/PCAP \;
cd ..
cd /drives/c/"Program Files"/Wireshark/
cmd /c mergecap -w c:/VLCC/$folder/PCAP/merged.pcap c:/VLCC/$folder/PCAP/*.pcap
cd ..
cd /drives/c/VLCC/$folder/PCAP/
tar -czvf merged.tar.gz merged.pcap
rm -rf *.pcap
else
echo "################################################################################"
echo
echo
echo " MERGECAP is \e[1;31m DISABLED\e[0m "
echo
echo
echo "################################################################################"
fi
cd /drives/c/VLCC/$folder
sed -n '/@!@/,/@!@/p' sbc_trace_details > ONGOING_TRACES.txt
sed -n '/@!@/,/@!@/p' mrf_trace_details >> ONGOING_TRACES.txt
sed -n '/@!@/,/exit/p' cif_trace_details >> ONGOING_TRACES.txt
sed -i 's/@!@//g' ONGOING_TRACES.txt
rm -f sbc_trace_details mrf_trace_details cif_trace_details
cd /drives/c/VLCC
rm -f status.txt
find . -type d -print | xargs rmdir 2>/dev/null
os_type=$(uname -s)
if [ "$os_type" == "Linux" ];then
cd $folder
else
explorer.exe "c:\VLCC\\$folder"
fi
echo "################################################################################"
echo
echo
echo " TRACE CAPTURE COMPLETED "
echo
echo
echo "################################################################################"
echo
echo
else
echo "Wrong Input"
fi
}
mon=$(date +%b)
pass=$1
call_type=$2
operation=$3
echo
echo
pre_pwd=$(cat script/data | grep $mon | cut -d ":" -f 2)
data=`echo $pre_pwd | openssl enc -aes-128-cbc -a -d -salt -pass pass:test 2>/dev/null`
echo
echo
echo
echo "$pwd"
if [ "$data" == "$pass" ] && [ $# == 3 ];then
Main $pass $call_type $operation
elif [ $# != 3 ];then
echo "*****************Run with proper argument eg:'./execute_me.sh password call_type start/stop'*****************"
elif [ "$data" != "$pass" ]; then
echo "*****************WRONG PASSWORD ENTERED*****************"
else
echo "*****************Run with proper argument eg:'./execute_me.sh password call_type start/stop'*****************"
fi