-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathip6to4.sh
More file actions
executable file
·57 lines (48 loc) · 1.43 KB
/
Copy pathip6to4.sh
File metadata and controls
executable file
·57 lines (48 loc) · 1.43 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
#!/bin/bash
# this file will convert and RTPDump file to an IPv4 formated file. It requiresthe suse of the RTPtools
#http://www.cs.columbia.edu/irt/software/rtptools/download/
. /etc/init.d/functions
INFILE=rtpstream.rtpdump
OUTFILE=ipv4_converted.pcap
LOG=convert.log
RTPTOOL_PATH=/usr/local/bin/
if [ $# -ne 2 ]; then
echo "Error parsing command line arguments"
echo "Usage:"
echo " $0 <rtpdump INFILE NAME> <ipv4 pcap OUTFILE NAME>"
exit 0
fi
INFILE=$1
OUTFILE=$2
echo "Starting Convert of $INFILE to $OUTFILE" > $LOG
# Use step(), try(), and next() to perform a series of commands and print
# [ OK ] or [FAILED] at the end. The step as a whole fails if any individual
# command fails.
step() {
echo -n -e "$@"
echo -e "\n\nSTEP - $@"&>> $LOG
STEP_OK=0
[[ -w /tmp ]] && echo $STEP_OK > /tmp/step.$$
}
next() {
[[ -f /tmp/step.$$ ]] && { STEP_OK=$(< /tmp/step.$$); rm -f /tmp/step.$$; }
[[ $STEP_OK -eq 0 ]] && echo_success || echo_failure
echo
return $STEP_OK
}
setpass() {
echo -n "$@"
STEP_OK=0
[[ -w /tmp ]] && echo $STEP_OK > /tmp/step.$$
}
step "Starting RTP Listener"
$RTPTOOL_PATH/rtpdump 127.0.0.1/57344 &>> $LOG &
next
step "Starting IP Capture"
tcpdump -B20000 -ilo -s0 -w $OUTFILE udp port 57344 &>> $LOG &
next
step "Starting RTP Playback Conversion..."
$RTPTOOL_PATH/rtpplay -T -f $INFILE 127.0.0.1/57344 &>> $LOG
next
echo "Convert of $INFILE complete!, new file is $OUTFILE"
echo