This is a bug existing in airodump-ng 1.2 rc4 (Released 14 Feb 2016) to airodump-ng 1.2 (Released 15 Apr 2018).
But in 18 Apr 2018, the GitHub user Mister-X fixed the problem. See the commit.
In src/airodump-ng.c
with the bug, it will use input_thread()
to create a thread regardless of whether the airodump-ng process running in the foreground or background.
The input_thread()
will call mygetch()
. And the mygetch()
will call getchar()
. Thus airodump-ng process will read stdin when running in the background.
In Linux, if a process reads stdin when running in the background, it will be stopped. And running timeout
without --foreground
option will let the COMMAND
, here is airodump-ng, run in the background. So in this situation, the airodump-ng will be stopped and create a empty .cap file (asked by you).
There are two lines of thinking to solve your problem:
Let the airodump-ng run in the foreground by using --foreground
option of timeout
or running source <your_orignal_script.sh>
.
Don't let the airodump-ng read stdin when running in background by redirecting stdin to /dev/null, timeout -sHUP 1m airodump-ng -d MYBSSID -w wpahandshake wlan0mon < /dev/null
or downloading the newest source code without the bug from GitHub then compile and install it.