[wifi] capture: add date to archive name
Add the current date and time to the archive name. Set the random part of the name to 2 characters.
This commit is contained in:
parent
627102d6ce
commit
ddfa6e0b49
|
@ -61,6 +61,8 @@ IFACE=$1
|
|||
OS=`uname`
|
||||
OS_RELEASE=`uname -r`
|
||||
HOSTNAME=`uname -n`
|
||||
# Current date:
|
||||
DATE=`date +%FT%H%M%S`
|
||||
|
||||
echo -n "Shuting down interface $IFACE... "
|
||||
ifconfig $IFACE down && echo "OK." \
|
||||
|
@ -88,7 +90,8 @@ ifconfig $IFACE up && echo "OK." \
|
|||
|| error "Cannot turn the interface up!"
|
||||
|
||||
echo "Capturing $NB_PKT packets..."
|
||||
DIR=$(mktemp -d "$TMP"/capture_${OS}-${OS_RELEASE}_${IFACE}_${HOSTNAME}-XXXXXXXXXX)
|
||||
DIR=$(mktemp -d \
|
||||
"$TMP"/capture_${OS}-${OS_RELEASE}_${IFACE}_${HOSTNAME}_${DATE}_XX)
|
||||
FILE="$DIR/$FILE"
|
||||
tcpdump -i $IFACE -c $NB_PKT -w "$FILE"
|
||||
echo "Capture file \"$FILE\" created."
|
||||
|
|
Loading…
Reference in New Issue