net/templates/run.sh: put log name in trace.pcap

It's hard to distinguish multiple wireshark windows with trace.pcap
files, as only the file name and not the path is shown in the title.
Make it easier to distinguish them by adding the log name to the file
name.

Change-Id: I7007d7c1e74aef46f1942f4f6f675adebb890955
This commit is contained in:
Oliver Smith 2022-02-17 10:08:14 +01:00
parent e33f85f193
commit 2cfd792312
1 changed files with 3 additions and 1 deletions

View File

@ -298,11 +298,13 @@ if [ -n "$log_name" ]; then
newlogdir="log/$log_name"
#scp "bts:/tmp/{bts,pcu}.log" "bts:neels/osmo-{bts,pcu}.cfg" "$logdir"
else
newlogdir="autolog/log_$(date +%Y-%m-%d_%H-%M-%S)"
log_name="log_$(date +%Y-%m-%d_%H-%M-%S)"
newlogdir="autolog/$log_name"
fi
mkdir -p "$(dirname "$newlogdir")"
mergecap -w "$logdir/trace.pcap" "$logdir/"*.single.pcap && rm -f "$logdir/"*.single.pcap
mv "$logdir/trace.pcap" "$logdir/trace-$log_name.pcap"
if [ -x "$newlogdir" ]; then
echo "already exists, move it manually: $newlogdir"