-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun
executable file
·75 lines (71 loc) · 1.45 KB
/
run
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
#!/bin/bash
if [ $1 = "help" ]; then
echo ""
echo "THIS IS A STATIC HELP OUTPUT - Real script could could have changed since this snapshot."
echo ""
echo "Script Arguments:"
echo " run"
echo " clean"
echo " help"
echo ""
./waf --run "coap --PrintHelp"
exit
elif [ $1 = "clean" ]; then
echo Removing stored .zip files
ls *.zip
rm *.zip
rm energy_*
rm *.pcap
rm coap_trace.tr
rm coap_animation.xml
rm state_*
rm routetables
rm output.log
else
echo removing old trace files
rm energy_*
rm *.pcap
rm *_rping
rm coap_trace.tr
rm coap_animation.xml
rm state_*
rm routetables
rm output.log
echo Starting simulation:
a="$(echo "$*" | tr ' ' _ | tr = _ | tr -d -)"
b="$(date +%s)"
c="_"
echo Arguments: $*
./waf --run "coap $*" &> output.log
echo Done
d="$a$c$b".zip
echo "Copying animation"
cp coap_animation.xml tempanim.xml
echo Compressing simulation to $d
zip $d energy_*
rm coap_trace.tr
rm coap_animation.xml
zip -u $d output.log
zip -u $d *.pcap
#zip -u $d coap_trace.tr
#zip -u $d coap_animation.xml
zip -u $d *_cache
zip -u $d state_*
zip -u $d scratch/coap.cc
zip -u $d routetables
#zip -u $d *_rping
echo Done
echo Removing files
rm energy_*
rm *.pcap
#rm coap_trace.tr
#rm coap_animation.xml
rm state_*
rm routetables
rm *_cache
rm *_rping
#tail -10 output.log
#rm output.log
du -h $d
#../netanim-3.107/NetAnim &
fi