[wifi] capture: add OS release to archive name

Add the OS release version to the archive name.
Extend the random part of the name to 10 characters.
This commit is contained in:
Matteo Cypriani 2011-08-06 12:30:39 +02:00
parent 9df17ae493
commit 99ea201832
1 changed files with 2 additions and 1 deletions

View File

@ -59,6 +59,7 @@ CHANNEL=1
IFACE=$1
# Machine information:
OS=`uname`
OS_RELEASE=`uname -r`
HOSTNAME=`uname -n`
echo -n "Shuting down interface $IFACE... "
@ -84,7 +85,7 @@ ifconfig $IFACE up && echo "OK." \
|| error "Cannot turn the interface up!"
echo "Capturing $NB_PKT packets..."
DIR=$(mktemp -d "$TMP"/capture_${OS}_${IFACE}_${HOSTNAME}-XXXXXXXX)
DIR=$(mktemp -d "$TMP"/capture_${OS}-${OS_RELEASE}_${IFACE}_${HOSTNAME}-XXXXXXXXXX)
FILE="$DIR/$FILE"
tcpdump -i $IFACE -c $NB_PKT -w "$FILE"
echo "Capture file \"$FILE\" created."