-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_rx_14
executable file
·30 lines (26 loc) · 1.02 KB
/
run_rx_14
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
#!/bin/bash
# Add the following to crontab -e to run this every minute:
# */1 * * * * /home/alex/sounder/run_rx > /home/alex/sounder/run_rx.log &
echo "Started run_rx - tail -f /var/log/syslog for more information"
current_time="`date +%Y/%m/%d_%H:%M`";
export sdir=/home/alex/sounder/odin.py
export outdir=/data
export chan1=zsp_3
export chan2=zsp_4
export mboard=192.168.10.14
export freq_list='/home/alex/sounder/freq_lists/mcm_ops.flist'
export rate=5E5
export type='sc16'
# Check output directory size as a function of time
sz1=`df $outdir/$chan1 | tail -n1 | awk '{print $3}'`
sleep 1
sz2=`df $outdir/$chan1 | tail -n1 | awk '{print $3}'`
# Start the receiver code if the directory is not getting bigger
if [ $sz1 == $sz2 ]; then
echo "Directory not getting bigger. Launching odin at ${current_time}"
python $sdir -m $mboard -d "A:A A:B" -c $chan1,$chan2 --type $type -f $freq_list -r $rate -i 10 $outdir &
else :
pid="`pgrep -x python`"
echo "odin.py running at ${current_time} possibly as pid ${pid}"
fi
exit 0